httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Hazin" <dha...@gmail.com>
Subject Re: [users@httpd] ServerAlias and redirecting, please help
Date Wed, 02 May 2007 05:03:16 GMT
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@slive.ca>:
> On 4/30/07, Dmitry Hazin <dhazin@gmail.com> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message