Re: mod_rewrite problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/4/07, Yves Goergen <nospam.list@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux