I have a domain on my server called example.com and I set up a subdomain called links.example.com. Whenever I go to links.example.com, the domain is pointing to the same directory, even though in the cPanel settings, I told it to go to /public_html/links instead of just public_html

What's weird is whenever I go to it through non-HTTPS, it points to the correct directory that I need it to go.

I do not have a .htaccess file setup yet. I read online that you can fix the issue by adding an SSL cert to that subdomain, but because I'm using cloudflare's SSL, I don't have an SSL cert to provide.

So for clarification:
http://example.com - shows content from /public_html/ (as it should)
https://example.com - shows content from /public_html/ (as it should)
http://links.example.com - shows content from /public_html/links/ (as it should) https://links.example.com - shows content from /public_html/ (which it shouldn't)

1 Answer 1


I fixed the issue using a cheap workaround. If anyone knows of any better, feel free to answer as well.

The issue was, there was no virtualhost for that subdomain for SSL. cPanel won't make a virtualhost unless there's a cert installed for that domain. I made a self-signed cert and installed it for that subdomain.

Since I'm using cloudflare's SSL, the self-signed doesn't matter, and the virtual host is now listening on port 433 meaning that SSL works properly for that subdomain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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