+44 (791) 5698 086

Cpanel error while adding the redirect [solved]

While adding a permanent 301 redirect to one of my old domains onto a new one hosted on a cpanel based server I encountered an error saying:

“There was an error adding the redirect.”

Redirecting “” to http://my-new-domain.com/ will cause a redirection loop because http://my-old-domain.com/ , which is located at “/domain/location/both/are/same/” is above “/domain/location/both/are/same/”.

cpanel there was an error adding redirect

Well if you read the error carefully, you can see that the reason for the redirect loop error is that both the domains, when added to addon domains (or sub domains) were having the files in same folder on the server.

So quite obviously, the solution is to change the folder path for the old domain from the new one.

The way I did it was, creating an entirely different folder for redirected domains on my server and point them to that folder in the addon domains / sub domains section and then add the redirect.

One more thing to make sure that the redirect is working fine is to add a trailing slash after the domain name “/”. Without it it might not give an error when you’re adding a 301 redirect on cpanel, but it will not work as per expected if you want a wildcard redirect.

 

It will work only on the main domain, but not on the wildcard redirect. If you’ll try to access the link directly it will give a “404 not found on server” error.

404 not found after wildcard redirect

Hope it will help you solve your domains 301 redirect issues. Let me know if you want my help in fixing and setting up your 301 redirects for your domains or subdomains.

2 Responses to Cpanel error while adding the redirect [solved]

  1. Phil Hudson

    Thank you for this. I use SiteGround.com and ran into a similar issue following their tutorial. The tutorial recommended I just park the domains, but this caused the wildcard redirect loop issue. I then just added them as Addon domains and realized the folder would be different this way, so I tested it and the wildcard redirects worked great.

    Thanks again, this was a real pain in the butt until I found this post.

    • Nabtron

      I’m glad to know that it was helpful to you. (even after 4 years of writing this post :D )

Leave a Reply

Your email address will not be published. Required fields are marked *

Who are we?

Nabtron team includes web, desktop software and mobile apps developers along with SEO professionals.

We are available 24 hours, 7 days a week. Contact us now for anything you need!

Join our mailing list

Lets become friend :) What's your name & email?