Domain parking/redirection loop bug in cPanel

Parking

I suffered an issue the other day that I though might be worth a mention. As well as MishterTea.com, I also own the domain MishterTea.co.uk. To get the .co.uk domain to forward to the .com site I added the .co.uk as a parked domain under the cPanel of the main site, then re-directed MishterTea.co.uk to MishterTea.com. Easy enough.

There was one slight problem though. When I visited a sub-folder of MishterTea.co.uk (i.e. /Links), it would remain on MishterTea.co.uk instead of forwarding. Turned out I needed a wildcard re-direct as well as making sure my target site ended with a ‘/’. The problem was that when I tried to append ‘/’ to my target domain, cPanel would fail: ‘Redirecting to http://www.mishtetea.com/ will cause a redirection loop..’.

After a bit of investigation it turned out cPanel was writing the wrong code to my .htaccess file. I believe this to be a known bug that’s et to be fixed. The solution? Do it manually:

RewriteCond %{HTTP_HOST} ^mishtertea.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.mishtertea.co.uk$
RewriteRule ^(.*)$ "http\:\/\/www\.mishtertea\.com\/$1" [R=301,L]

If copying, you’ll just need to change the ‘mishtertea.co.uk’ and ‘mishtertea.com’ to you source and destination domains respectively. Once updated this also shows up correctly in cPanel.

Posted in Coding, Web | Tagged , , , | Leave a comment

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

> Talk to me!

Twitter profile for Richard Turnbullwitter:
  • Attempting to load Twitter feed..
Facebook profile for Richard Turnbull LinkedIn profile for Richard Turnbull

> Tools

Share |

> Advert