multiple domain names to same site

Discussions about SEO principles. Learn how to get better indexed.

Moderator: Moderators

Postby dcz » Tue Jun 05, 2007 3:53 pm

I guess you can post in the www prefix thread, or start a new topic in the Apache mod rewrite forum if it's only a technical matter (you already now what you want seo wise).

I hope you understand I'm only trying to keep thing a clear as possible for everybody here, which of course goes along with a bit of cooperation with our dear community.


Anyway, while we're at, here is how you should proceed :

Add this in your .htaccess, right after the rewritebase line :
Code: Select all
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]


And just replace example\.com with the domain you want to use in the end.

All other domain leading in the same folder on the server will be redirected, anything but -www.example.com will be redirected, meaning example.com as well, which the dupe almost everybody has to deal with, the www prefix one.

If you read the www prefix thread a bit, you'll see that it's possible that this syntax will not exactly be the one working on your server, you may need to get rid of the trailing $ at the end of the RewriteCond for example, but that's how we redirect all at once easily.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Postby noworyz » Tue Jun 05, 2007 4:15 pm

Yes, I do have the www prefix "fix" already functioning for my site (great info on this site to set that up :D ). I was trying to figure out how to do this for a second domain. Thanks for your help and I do understand your wanting to keep the place organized!
noworyz
PR0
PR0
 
Posts: 97
Joined: Mon Jan 08, 2007 10:36 pm

Previous

Return to SEO Principles

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests