On 8/4/07, Yves Goergen <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to