JiveMedia
asked on
htaccess Redirect
Hi,
I have 2 domains linked to the one website on my server (.net.au and .com.au). I want all access directed to the .com.au. I currently have the below in my htaccess file which works fine.
RewriteCond %{HTTP_HOST} ^www.domain.net.au$ [NC]
RewriteRule ^(.*)$ http://www.domain.com.au/$1 [L,R=301]
One little problem, if the user types the address domain.net.au without the www. it still takes them to the net.au address. I need the www. and non www. on domain.net.au to go to the .com.au.
What rule do i need to add to achieve this?
I've tried adding a few rules and can't seem to get it working.
Any help will be appreciated, thanks.
I have 2 domains linked to the one website on my server (.net.au and .com.au). I want all access directed to the .com.au. I currently have the below in my htaccess file which works fine.
RewriteCond %{HTTP_HOST} ^www.domain.net.au$ [NC]
RewriteRule ^(.*)$ http://www.domain.com.au/$1 [L,R=301]
One little problem, if the user types the address domain.net.au without the www. it still takes them to the net.au address. I need the www. and non www. on domain.net.au to go to the .com.au.
What rule do i need to add to achieve this?
I've tried adding a few rules and can't seem to get it working.
Any help will be appreciated, thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just as an alternative, it's better to configure that in the site definition with the server alias directive.