Redirect a Main Domain in cPanel to it's Parked Domain

      Redirect a Main Domain in cPanel to it's Parked Domain




I have a main domain, 'redirect-from.com' with user name 'redirect' in my cpanel and I have craeted a parked domain 'redirect-to.com' in this account. As you know both are loading the same pages here.

I need to redirect the url, http://redirect-to.com/ to http://redirect-to.com/ , for that I have select the option, 'Redirect' from the cPanel and I have encountered an error like the following when adding the redirect. I have this problem only when creating a redirect via cPanel when creating redirect rule from the main domain to a parked domain in the same account.


Error Adding Redirection

Redirecting "" to "http://redirect-to.com/" will cause a redirection loop because "http://redirect-from.com/", which is located at "/home/redirect/public_html/", is above "http://redirect-to.com/", which is located at "/home/redirect/public_html/" .



I have created a rule in my htaccess as follows to redirect the main domain to it's parked domain.


# cat /home/redirect/public_html/.htaccess

###########################

RewriteEngine On

RewriteCond %{HTTP_HOST} ^redirect-from.com$ [NC]
RewriteRule ^(.*) http://redirect-to.com/$1 [R=301,L]

##########################

3 thoughts on “Redirect a Main Domain in cPanel to it's Parked Domain”


  1. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article.
    Thanks for sharing such a nice info.I hope you will share more information like this. please keep on sharing!

    internship in chennai
    internship in chennai for cse
    internship for mba in chennai
    internship in chennai for hr
    internship in chennai for mba
    companies for internship in chennai
    internship in chennai for ece
    paid internship in chennai
    internship in chennai for biotechnology
    internship in chennai for b.com students