Rewrite Confusion

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


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-14-2007
Dave Gresham
 
Posts: n/a
Default Rewrite Confusion

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
  #2 (permalink)  
Old 01-15-2007
petersprc
 
Posts: n/a
Default Re: Rewrite Confusion

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:05 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0