Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have full server control (WHM, CPanel, CentOS 5). I set up a sub domain in CPanel.

Now, a very odd problem to me. is properly going to its root path and displaying as such.

However,, although the url remains looking just like that, displays the content from the path linked to Has anyone seen behavior like this? If so, what could the culprit be?

I'll need some somewhat detailed responses if I'm going to be editing anything in WHM or via SSH as root - I want to be very careful I don't mess anything up...and this is semi new to me.



Apache Server!

share|improve this question
Could you, please write at least the webserver, you are using: (apache, nginx)? Didn't you forget that a website for "http" and for "https" are different virtual hosts? May be it is worth posting some configuration files? – HUB Jul 19 '11 at 14:46
Agreed HUB, we need more info. If you are using Apache you should be able to add the subdomain to the httpd.conf or create its own .conf for it and reload apache. cPanel should have let you set the doc root during the subdomain setup, however, it is not difficult to manually add this. – Chase Jul 19 '11 at 16:58
@HUB sorry, Apache! I really don't feel comfortable posting config files... – Shackrock Jul 19 '11 at 23:40
@Chase Indeed I did set the doc root for the subdomain. That is why works fine. However it's the HTTPS that redirects incorrectly... so I assume I do need to get into the conf files, I just have no idea where to find them, what to edit/add... – Shackrock Jul 19 '11 at 23:41
@Shackrock ssh to your server and the Apache configs are located in /etc/httpd/conf/httpd.conf Just create a virtual host for as opposed to :80. you will need to reference the SSL cert in your config as well if you want it to be trusted. – Chase Jul 22 '11 at 16:19
up vote 2 down vote accepted

It's a common limitation of Apache/SSL using standard SSL certificates (you can avoid this using wildcard or multi-domain certs as Shane mentioned above)

Since everything is encrypted, Apache doesn't know what is the host header, so he doesn't know which certificate to load.

The first/default vhost binded to the IP of (Which is most likely shared with will be used.

You need to use a dedicated IP for each SSL vhosts.

share|improve this answer
What about server name indication? Or lacking that, how about wildcard or alternate name certificates? – Shane Madden Jul 19 '11 at 15:40
SNI is still not the answer because people are still using IE6 (duh!) and some browser may be incompatible. A wildcard certificate is only a way to not buy a cert for each subdomains you have. You'll still need to use a different IP for each one of them. – poilache Jul 19 '11 at 15:46
That's not the case at all. SNI gets you the ability to present a different cert based on which host is being requested - but if you can present the same cert for all hosts on an address (with a wildcard or alternate name cert), then normal old host headers, happening after SSL negotiation, work just fine. For instance, check out the IP addresses and certificates on vs; same IP, same cert, different content (.net spits out a redirect, while .com serves a page). – Shane Madden Jul 19 '11 at 16:25
Sure, but you can pretty much say that about anything that you do with a virtual host. I am telling you that it's the case, that I have run dozens of SSL virtualhosts on a single IP with a wildcard cert without SNI. – Shane Madden Jul 19 '11 at 18:51
Right on, +1. (more characters) – Shane Madden Jul 19 '11 at 20:11

From what I understand you can only have one SSL per cpanel, the way around this seems to be to have a wildcard SSL certificate

Take a look at these

share|improve this answer

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.