Multiple Domains redirecting to one domain?

Using a single web hosting account to host multiple sites

Multiple Domains redirecting to one domain?

Postby jdoggz316 » Tue Mar 29, 2005 8:40 am

I'm not sure mod-rewrite can do this: But i've looked over the apache docs, way too complex -

In plain english i have:

domain.com
domain1.com
domain2.com
domain3.com

If someone goes to domain1.com/file1.htm

I need it to redirect to

domain.com/file1.htm

furthermore domain2.com/dir/file2.htm to

domain.com/dir/file2.htm

Is this possible??

Thank you.
jdoggz316
 

Postby Caterham » Wed Mar 30, 2005 5:06 am

I need it to redirect to
=external redirect?

Is this possible??
Yes. Do you have a wildcard DNS (all domains are pointing to domain.com?)

There are a lot of examples here in the forum, search for HTTP_HOST

i.e. viewtopic.php?p=2391#2391

RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 104 guests

cron