Ratings, reviews, plans and features to help you find the right web hosting provider for your site.

301 Permanent redirects for parked domain names

Web Hosting Articles » A simple guide to .htaccess » 301 Permanent redirects for parked domain names



If you have several domain names parked/pointed at your site it is a good idea to create permanent 301 redirect for them so for the search engines not to treat them as duplicate content.

Here is a sample .htaccess that will do that:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^parkeddomain-2.com$
RewriteRule ^(.*)$ http://www.maindomain.com/$1 [R=301]

And even more generic solution would be:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.maindomain.com$
RewriteRule ^(.*)$ http://www.maindomain.com/$1 [R=301]

  1. How to block users from accessing your site based on their IP address
  2. How to prevent or allow directory listing?
  3. How to change the error documents – 404 Page Not Found, etc
  4. Using .htaccess for password protecting your folders
  5. Using .htaccess to block referrer spam
  6. Disable Hot-Linking of images and other files
  7. Redirect URLs using .htaccess
  8. Introduction to mod_rewrite and some basic examples
  9. Force SSL/https using .htaccess and mod_rewrite
  10. 301 Permanent redirects for parked domain names
  11. Enable CGI, SSI with .htaccess
  12. How to add Mime-Types using .htaccess
  13. Change default directory page
  14. Block Bad robots, spiders, crawlers and harvesters
  15. Make PHP to work in your HTML files with .htacess
  16. Change PHP variables using .htaccess
  17. HTTP Authentication with PHP running as CGI/SuExec
  18. Force www vs non-www to avoid duplicate content on Google
  19. Duplicate content fix index.html vs / (slash only)

Comments 8 >>

Volunteer Abroad Said,
Apr 15, 2008 @ 05:39

Thanks - this helped me loads!
Palestine Students Forum Said,
Oct 20, 2008 @ 14:20

thanks very much its help me for parked domains
Mia Said,
Apr 08, 2009 @ 08:23

Thank,s for the education.
Great advice and easy to understand.
I have added you to my fav list and will return.
Thanks again..Mia
kindyroot Said,
Nov 26, 2009 @ 09:40

It says:
"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
steve Said,
Jan 01, 2010 @ 11:39

thanks, not sure what it all means but im slowly learning.

im actually trying to point a parked domain to a folder which carries a seperate language on my main domain...

ie.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^parkeddomain.cl$ [OR]
RewriteCond %{HTTP_HOST} ^parkeddomain-2.ar$
RewriteRule ^(.*)$ http://www.maindomain.com/es/$1 [R=301]

that didn't work - not sure if there is a way to do it?
thanks
arya Said,
Jul 11, 2010 @ 22:34

what about the backlink at parked domain ? google or yahoo will count too ?
Portland SEO Service Said,
Aug 06, 2010 @ 21:58

Arya, the 301 permanent redirect will inform the search engines that count all backlinks as well
Sam Said,
Jul 25, 2011 @ 18:12

I have already auto redirected my .org domain to https://www.mydomain.org

Now I have parked mydomain.com to the .org and the browsers are saying its not a safe linke when the .com redirects to my .org https. any help?
Your comments on this article

(required)

(required but never displayed)



security code



Previous: Force SSL/https using .htaccess and mod_rewrite Next: Enable CGI, SSI with .htaccess