Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have which is the domain that hosts other domains.

On cPanel normally you can get to the actual cPanel by visiting, or

What I would like to accomplish is to have the hosteddomains cPanel auto redirect to something like . Doing this would allow me to adequately throw an SSL cert in my. and really offer a secure experience to my users.

I know it's possible because bluehost does the same. They redirect to

Can anyone think of how to do it?

share|improve this question

migrated from Sep 27 '12 at 1:25

This question came from our site for professional and enthusiast programmers.

2 Answers 2

You could try putting something like this in the htaccess file of your main domain's document root or in the vhost config:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^my\. [NC]
RewriteCond %{HTTP_HOST} ^cpanel\. [NC,OR]
RewriteCond %{REQUEST_URI} ^/cpanel
RewriteRule ^ [L,R=301]
share|improve this answer
That would redirect and but is there also a way to redirect I like where you're headed though.. I will add that in as a start. –  Peter Sep 27 '12 at 4:55

You can create a CNAME DNS record with the subdomain pointing to This way, the user will be able to access any of the resources available on (such as but will be a part of the subdomain.

A CNAME DNS record, btw, creates an "alias" to another subdomain or domain. It is NOT a good idea to create a CNAME record for the root/apex domain, e.g. a CNAME record from pointing to

share|improve this answer
Does the person who downvoted this care to explain why this is not a valid or technically-correct answer? –  L0j1k Sep 26 '12 at 18:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.