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]
- How to block users from accessing your site based on their IP address
- How to prevent or allow directory listing?
- How to change the error documents – 404 Page Not Found, etc
- Using .htaccess for password protecting your folders
- Using .htaccess to block referrer spam
- Disable Hot-Linking of images and other files
- Redirect URLs using .htaccess
- Introduction to mod_rewrite and some basic examples
- Force SSL/https using .htaccess and mod_rewrite
- 301 Permanent redirects for parked domain names
- Enable CGI, SSI with .htaccess
- How to add Mime-Types using .htaccess
- Change default directory page
- Block Bad robots, spiders, crawlers and harvesters
- Make PHP to work in your HTML files with .htacess
- Change PHP variables using .htaccess
- HTTP Authentication with PHP running as CGI/SuExec
- Force www vs non-www to avoid duplicate content on Google
- Duplicate content fix index.html vs / (slash only)
Comments 8 >>
Volunteer Abroad Said,
Apr 15, 2008 @ 05:39
Thanks - this helped me loads!
Mia Said,
Great advice and easy to understand.
I have added you to my fav list and will return.
Thanks again..Mia
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,
"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
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,
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
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,
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?
Jul 25, 2011 @ 18:12
I have already auto redirected my .org domain to https://www.mydomain.orgNow 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?
| Previous: Force SSL/https using .htaccess and mod_rewrite | Next: Enable CGI, SSI with .htaccess |
