httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] mod_rewrite problem
Date Sat, 04 Aug 2007 16:25:26 GMT
On 8/4/07, Yves Goergen <nospam.list@unclassified.de> wrote:
> Hello,
>
> I'm using mod_rewrite to correct some URLs on my web server, running
> Apache 2.0. But I have a strange problem with it. First, here's the
> rules I have set:
>
>     SetEnvIf Host .+ desired_hostname=beta.unclassified.de
>     SetEnvIfNoCase Host ^beta\.unclassified\.de$ !desired_hostname
>
>     RewriteCond %{ENV:desired_hostname} !^$
>     RewriteRule ^(.*) http://%{ENV:desired_hostname}/$1 [L,R=301]

Once you know that you need to use mod_rewite, there is no point in
fooling around with mod_setenvif. It is simpler to do everything in
mod_rewrite. Or avoid it entirely.

Try one of the solutions here:
http://wiki.apache.org/httpd/CanonicalHostNames

Also note that you should not do rewriting in .htaccess unless you
really have to. And if you still use mod_rewrite and can't get it to
work, then use the RewriteLog to see what is going on.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message