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.
.htaccess, mod_rewrite, and multiple domain extensions
Moderator: General Moderators
- Mark Oates
- Forum Newbie
- Posts: 4
- Joined: Wed Dec 03, 2008 3:52 am
- Peter Anselmo
- Forum Commoner
- Posts: 58
- Joined: Wed Feb 27, 2008 7:22 pm
Re: .htaccess, mod_rewrite, and multiple domain extensions
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.
- Mark Oates
- Forum Newbie
- Posts: 4
- Joined: Wed Dec 03, 2008 3:52 am
Re: .htaccess, mod_rewrite, and multiple domain extensions
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.
I'm doin it fur teh SEOs.
-
aschlosberg
- Forum Newbie
- Posts: 24
- Joined: Fri Jan 23, 2009 10:17 pm
Re: .htaccess, mod_rewrite, and multiple domain extensions
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
-
blenderheadStudios
- Forum Newbie
- Posts: 1
- Joined: Thu Jan 14, 2010 6:33 pm
Re: .htaccess, mod_rewrite, and multiple domain extensions
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).