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



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