Domain-1 URL match - Redirect to domain-2 URL

Using a single web hosting account to host multiple sites

Domain-1 URL match - Redirect to domain-2 URL

Postby psibrtyger » Tue Nov 21, 2006 5:10 pm

Currently I have multiple domains setup but I want a match for all domain URLs to redirect to another domain.


1) http://www.domain.com/ -> REDIRECT -> http://www.domain2.com/
2) https://www.domain.com/ -> REDIRECT -> http:/www.domain2.com/
3) http://domain.com/ -> REDIRECT -> http://www.domain2.com/
3) https://domain.com/ -> REDIRECT -> http://www.domain2.com/


I have an application running at https://sub.domain.com/admin/ and
http://sub.domain.com/
I don't want it to redirect to http://www.domain2.com/ if either is matched.

There are MANY sub domains and only ONE domain.

I have the following code:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www\.)?form25.com/$ [NC]
RewriteRule .* http://www.marketpathsolutions.com/ [L]


I am new to this and confused. Just looking for some pointers and or good code that can handle all cases.
psibrtyger
 
Posts: 1
Joined: Tue Nov 21, 2006 4:56 pm

Postby richardk » Wed Nov 22, 2006 8:56 am

Try:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain2.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 20 guests

cron