Page 1 of 1
.htaccess, mod_rewrite, and multiple domain extensions
Posted: Sat Dec 06, 2008 1:12 pm
by Mark Oates
I have a website
http://www.allmusiclibrary.com, and also own the .org, and .net extensions for this domain. I of course have all of the domains display the same information, however if I type in .org I want to rewrite the domain to .com in the address bar.
I've only been able to find information on rewriting for
old urls, but this doesn't change the url in the address bar. I want to "correct" what's in there, any help is appreciated.
Re: .htaccess, mod_rewrite, and multiple domain extensions
Posted: Sat Dec 06, 2008 1:24 pm
by Peter Anselmo
The way I handle this (and others may have different methods) is to not involve apache, but simply have my domain registrar forward the domains to the one I want to display. I'm not sure if that's the most SEO friendly way, but it's certainly easy.
Re: .htaccess, mod_rewrite, and multiple domain extensions
Posted: Sat Dec 06, 2008 1:50 pm
by Mark Oates
hmm, I'm looking for the most SEO friendly way. Personally, I could care less if other people see org/net, but I'm squeasing the SEO juice out.
I'm doin it fur teh SEOs.

Re: .htaccess, mod_rewrite, and multiple domain extensions
Posted: Sat Jan 24, 2009 2:59 am
by aschlosberg
I'm not sure that the syntax is exactly correct but try something like this:
Code: Select all
RewriteCond %HTTP_HOST yourdomain\.(net|org)$
RewriteRule (.*) http://yourdomain.com$1
Re: .htaccess, mod_rewrite, and multiple domain extensions
Posted: Thu Jan 14, 2010 6:47 pm
by blenderheadStudios
You should use a 301 status code redirect, because it will transfer the link equity from your previous URL to your new one. (301 is a permanent redirect).