Re: ServerAlias and redirecting, please help

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

 



I tried the following directives to force redirect:

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

But still no success; it opens the index page of the
http://www.site.ru when typing 'xx.site.com' but url doesn't change in
the browser and index page is opened instead of
http://www.site.ru/some/location

It seems that ServerAlias directive overrides RewriteRule one, because
the server response to xx.site.com is 302 Moved Temporarily instead of
supposed 301 written in the RewriteRule. Does this mean that I need to
remove xx.site.com from ServerAlias directive and if so what will be
the correct configuration?

Thanks,
Dmitry

2007/5/1, Joshua Slive <joshua@xxxxxxxx>:
On 4/30/07, Dmitry Hazin <dhazin@xxxxxxxxx> wrote:

> What is the correct way to configure apache so it will redirect from
> xx.site.com to http://www.site.ru/some/location ?

See:
http://wiki.apache.org/httpd/Recipes/CanonicalHostNames

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