rewrite

Using a single web hosting account to host multiple sites

rewrite

Postby markus » Tue Feb 15, 2005 4:42 am

I have serious problems with mod_rewrite
I rewrite two domains like,

https://www.domain-test.de to https://www.dm-test.de

I wrote the rewrite condition to the ssl configfile. When I call https://www.domain-test.de, I get:


File does not exist: /var/local/apache/htdocs/blank.html, referer: https://www.ww.domain-test.de/

Any Ideas?
markus
 

Postby Caterham » Tue Feb 15, 2005 7:59 am

sounds like a configuration issue... is blank.html the default DirectoryIndex?

I wrote the rewrite condition to the ssl configfile
and what in specific?
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

answer

Postby markus » Tue Feb 15, 2005 10:35 pm

We created a txt file called extdomredirect.txt. Within this file we wrote e.g.

www.domain1.de www.domain2.de

the following RewriteRule works with http but with https I get the mentioned error.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteOptions inherit
RewriteLogLevel 0

# geno webmanager urls
RewriteMap extdom txt:/usr/local/apache2/conf/extdomredirect.txt
RewriteCond ${extdom:%{HTTP_HOST}|none} !none [NC]
RewriteRule (.*) https://${extdom:%{HTTP_HOST}}$1 [R,L]
.....


The RewriteOptions inherit the following

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog "/var/log/apache/rewrite.log"
RewriteLock "/var/log/apache/rewrite.lck"
RewriteLogLevel 0

RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} ^~
RewriteRule ^/(.*) /~$1
RewriteRule ^/~+([^/]+)(.*) /~${lowercase:$1}/$2 [PT,L]
</IfModule>


Any Ideas???
markus
 

Postby Caterham » Wed Feb 16, 2005 12:36 pm

I cannot find any errors here which might cause such error...

Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteOptions inherit
RewriteLogLevel 0

# geno webmanager urls
RewriteMap extdom txt:/usr/local/apache2/conf/extdomredirect.txt
RewriteCond ${extdom:%{HTTP_HOST}|none} ^(.+) [NC]
RewriteCond %1 !^none
RewriteRule ^/(.*) https://%1/$1 [R,L]




The RewriteOptions inherit the following

There is just one rule below which will never match the Condition
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog "/var/log/apache/rewrite.log"
RewriteLock "/var/log/apache/rewrite.lck"
RewriteLogLevel 0

RewriteMap lowercase int:tolower
# the following RWCond will never match,
# request_uri always starts with a leading slash
#RewriteCond %{REQUEST_URI} ^~
#RewriteRule ^/(.*) /~$1
# if you would like to rewrite requests with a missing ~, use
#RewriteRule !^/~(.+) /~$1
RewriteRule ^/~+([^/]+)(.*) /~${lowercase:$1}/$2 [PT,L]
</IfModule>


Try to setup a RewriteLog with loglevel 5. But as there is no difference between http and https requests from the point of the syntax of the rules, it must be some other configuration issue. Try to place the rules into the main server configuration, if you can.
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 92 guests

cron