httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] Domain redirect with browser location change
Date Fri, 18 Jun 2004 17:40:32 GMT

On Fri, 18 Jun 2004 RBaker@safehorizon.org wrote:

>
> Joshua,
>
> Thanks for pointing that out. I saw that in the FAQ, but it didn't seem
> terribly descriptive.  It directs you to either the VirtualHosts
> documentation (which is very general and although I've read it, it didn't
> clarify the question for me) or the  mod_rewrite documentation (which is
> very complex and I couldn't seem to wrap my brain around it).  I was hoping
> someone on this list might have come across this issue themselves and might
> have an example of a solution at hand.

It also provides an example that does exactly what you want:

NameVirtualHost *

<VirtualHost *>
   ServerName www.example.net
   ServerAlias example.com
   Redirect permanent / http://www.example.com/
</VirtualHost>

<VirtualHost *>
   ServerName www.example.com
   DocumentRoot /usr/local/apache/htdocs
</VirtualHost>

Any host matching the ServerName or ServerAlias in the first <VirtualHost> 
will be redirected to the second <VirtualHost>.

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


Mime
View raw message