Re: ServerAlias and redirecting, please help

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

 



Yes, that was my mistake. Anyway, without that line it didn't work too :(
It seems that apache doesn't read RewriteRule directive after it had
read ServerAlias one..
What do you mean "the technique of having two <VirtualHost>s"?
We do have 2 virtualhosts: one for www.site.com and one for www.site.ru
Do you suppose putting redirect directive into the www.site.com one or what?
And what to do with ServerAlias then?

2007/5/2, Joshua Slive <joshua@xxxxxxxx>:
On 5/2/07, Dmitry Hazin <dhazin@xxxxxxxxx> wrote:
> I tried the following directives to force redirect:
>

Well, I think the technique of having two <VirtualHost>s is clearer,
but anyway...

> RewriteCond %{HTTP_HOST}   ^xx\.site\.com [NC]
> RewriteCond %{HTTP_HOST}   ^$
> RewriteRule ^/(.*)         http://www.site.ru/some/location/$1 [L,R=301]

Delete the second RewriteCond. Those conditions must all be met for
the RewriteRule to be applied, and obviously the Host can't be
simultaneously xx.site.com and empty.

Also, use the RewriteLog to debug problems with mod_rewrite.

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



---------------------------------------------------------------------
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