Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I bought 1 domain with different extensions (.fr, .com, .org, .net) and I've heard it's so bad for SEO not to redirect all of them to one only.

My question is quite simple. How do I do? I have a VPS with Apache2 on it.

Thanks!

share|improve this question
    
Solved my problem. serverfault.com/questions/281771/… –  Kentino Feb 17 '13 at 14:40

1 Answer 1

up vote 1 down vote accepted

Let all of the domains point to one webserver and configure it like this (example given for apache):

# Necessary for named vhosts
NameVirtualHost *:80

<VirtualHost *:80>
  # Accept all domains for this vhost
  ServerName foo.com
  ServerAlias foo.fr
  ServerAlias foo.org
  ServerAlias foo.net

  RewriteEngine on
  # Match requests that don't have the main domain only...
  RewriteCond %{HTTP_HOST} (?:www\.)?foo\.(?:fr|org|net)
  # ... rewrite them to use the main domain
  RewriteRule ^/(.*)$ http://foo.com/$1 [R,L]
</VirtualHost>
share|improve this answer
    
Even better than my solution :D <3 –  Kentino Feb 17 '13 at 15:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.