Forum Moderators: phranque

Message Too Old, No Replies

multiple URLs

redirrect

         

WhosAWhata

9:23 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



i have two websites on one server: site1.com and site2.com
i want anything like site1.com/folder/whatever to stay the same
i want anything like site2.com/folder/whatever to be redirected to site2.site1.com/folder/whatever

i'm thinking:

RewriteEngine ON
RewriteCond %{REQUEST_URL}% ^(.*)site2.com
RewriteRule (.*)site2.com(.*) [site2.site1.com...]

any other suggestions/comments?

jdMorgan

12:59 am on Apr 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The hostname won't be part of the URI, unless you write code to force it. Use RewriteCond %{HTTP_HOST} to detect the hostname you want to redirect from.

I'd suggest a review of the Apache URL Rewriting Guide [httpd.apache.org] before proceeding.

Jim

WhosAWhata

9:27 pm on Apr 23, 2004 (gmt 0)

10+ Year Member



thanks for the tip