Domain Redirection Problems

Using a single web hosting account to host multiple sites

Domain Redirection Problems

Postby bakerboy » Wed Nov 19, 2008 1:41 am

Hi,

I am a newbie to .htaccess and domain redirection. I have been looking for the following in the threads but no success with the other examples

I am on virtual host using Drupal.

The primary domain is:

domain.com.au

We also have the following domains pointing to domain.com.au

domain.com
domain.org.au
domain.asn.au

How can i redirect the above domains to domain.com.au using .htaccess

Any suggestion would be much appreciated.
bakerboy
 
Posts: 2
Joined: Wed Nov 19, 2008 1:21 am

Postby richardk » Wed Nov 19, 2008 7:27 am

Do you have any sub domains that need preserving?
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^((.+\.)?example\.)(asn\.au|com|org\.au)$ [NC]
RewriteRule ^(.*)$ http://%1com.au/$1 [R=301,L]


Or should every domain and sub domain go to www.example.com.au?
Code: Select all
Options +FollowSymLinks

RewriteEngine On

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

Thank you Richardk

Postby bakerboy » Wed Nov 19, 2008 3:09 pm

Many thanks Richardk, it work fine.
bakerboy
 
Posts: 2
Joined: Wed Nov 19, 2008 1:21 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 18 guests

cron