I've registered 3 domains, all for the same site. I've done this to catch people who can't remember the right URL. So I've got:
- domain.com.au
- domain.org
- domain.org.au
The hosting is under #1, with #2 and #3 as parked domains.
- I want everybody to get directed to #3 (domain.org.au) because it is a site for non-profit charity in Australia.
- I'm using Wordpress. Within the Wordpress admin settings I've set the site to be visible at the root of the domain, which has created two .htaccess files: one in root, and one in the wordpress-folder.
- The file I'm editing is in the root, and currently look like this:
# BEGIN WordPress
IfModule mod_rewrite.c> # deliberate missing open tag to show this line here
RewriteEngine On
RewriteBase / # from Wordpress
RewriteCond %{REQUEST_FILENAME} !-f # from Wordpress
RewriteCond %{REQUEST_FILENAME} !-d # from Wordpress
RewriteRule . /index.php [L] # from Wordpress
# Point all domains to .org.au
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com\.au [NC]
RewriteRule ^(.*)$ http://domain.org.au/$1 [R=301,L]
# RewriteCond %{HTTP_HOST} ^(www\.)?domain\.org [NC]
# RewriteRule ^(.*)$ http://domain.org.au/$1 [R=301,L]
/IfModule> # deliberate missing close tag to show this line here
# END WordPress
My first redirect works fine, but when I add the .org -> .org.au the browser chokes and says I have to many redirects. Which is possible, this is my first foray into .htaccess. So - what am I doing wrong?