This is a discussion on Rewrite Confusion within the Apache Web Server forums, part of the Web Server and Related Forums category; I am working with a place to consolidate a few websites under one site name.. In the past we had ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am working with a place to consolidate a few websites under one
site name.. In the past we had www.example1.com, www.example2.com. I am trying to consolidate example2.com into example1.com. What I had done in my httpd.conf was have the following: <VirtualHost 192.168.90.243> ServerAdmin webmaster@example2.com DocumentRoot /web/example2/www2/ ServerName www.example2.com ErrorLog /var/apache/logs/example2/error_log #RedirectMatch 301 / http://www.example1.com/gogindex.html #RedirectMatch 301 (.*) http://www.example1.com$1 CustomLog /var/apache/logs/ejgoggles/access_log combined </VirtualHost> What I would like to have happen is if someone goes to www.example2.com that they get redirected to the gogindex.html page. If they go to anything other than http://www.example2.com/whatever that they get redirected to http://www.example1.com/whatever If I remove the '#' on the 2nd redirect I get what I need except if they go to www.example2.com/ they get to example1.com's main index page. I want them to go to the gogindex.html page. Any Help would be apreciated. Dave |
|
|||
|
Maybe something like this would work:
RedirectMatch 301 ^/?$ http://www.example1.com/gogindex.html RedirectMatch 301 (^/.+) http://www.example1.com$1 Dave Gresham wrote: > I am working with a place to consolidate a few websites under one > site name.. In the past we had www.example1.com, www.example2.com. > > I am trying to consolidate example2.com into example1.com. What > I had done in my httpd.conf was have the following: > > > <VirtualHost 192.168.90.243> > ServerAdmin webmaster@example2.com > DocumentRoot /web/example2/www2/ > ServerName www.example2.com > ErrorLog /var/apache/logs/example2/error_log > #RedirectMatch 301 / http://www.example1.com/gogindex.html > #RedirectMatch 301 (.*) http://www.example1.com$1 > CustomLog /var/apache/logs/ejgoggles/access_log combined > </VirtualHost> > > What I would like to have happen is if someone goes > to www.example2.com that they get redirected to the gogindex.html > page. If they go to anything other than > http://www.example2.com/whatever that they get > redirected to http://www.example1.com/whatever > > If I remove the '#' on the 2nd redirect I get what I need except > if they go to www.example2.com/ they get to example1.com's main > index page. I want them to go to the gogindex.html page. > > Any Help would be apreciated. > > > Dave |