[thelist] apache redirect from one domain to another

Noah St.Amand noah at tookish.net
Thu Nov 4 12:24:16 CST 2004

evolt at mccullough-net.com wrote:

> Yes.  Basically the .com and the .net are the same site and same code.  It
> should be that the .com domain takes all request and the .net just allows
> customers with that domain to get to the .com domain.

If you want everything to redirect to the .com domain, but with the path 
intact if the request was for the .net domain, you can do this in 
httpd.conf (this is the .net domain):

<VirtualHost *>
     ServerName www.example.net
     Redirect / http://www.example.com/
     RedirectMatch (.*)\..* http://www.example.com$1

So http://www.example.net/about_us/mission_statement.html would redirect 
to http://www.example.com/about_us/mission_statement.html


More information about the thelist mailing list