Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We recently bought a wildcard certificate and installed it for a domain. It works fine for the main domain but seems to not work at all for any sub domains.

Whats happening is we can access the sub domains fine on HTTP, but whenever we try HTTPS for the same sub domain url we are redirected back to the main domain.

So if I put up a test folder httpstest in a sub domain with an index.html file in it, the following happens:

  • mysubdomain.mywebsite.com/httpstest/index.html or

  • mysubdomain.mywebsite.com/httpstest/

works perfectly fine with HTTP, but

  • mysubdomain.mywebsite.com/httpstest/ or

  • mysubdomain.mywebsite.com/httpstest/index.html

does not work with HTTPS and redirects to the main domain [mywebsite.com].

The site is not the main site used for setting up the VPS. It was added from WHM.

Environment: We are on a Linux VPS.
Cpanel 11.30.6 , Apache 2.2.22, PHP 5.3.13

The Virtualhost entry looks like this:

<VirtualHost xx.xx.xxx.xx:443>  
    ServerName my-own-website.com    
    ServerAlias www.my-own-website.com  
    DocumentRoot /home/amitabh/public_html  
    ServerAdmin webmaster@my-own-website.com  
    UseCanonicalName Off  
    CustomLog /usr/local/apache/domlogs/my-own-website.com combined  
    CustomLog /usr/local/apache/domlogs/my-own-website.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."  
    ## User amitabh # Needed for Cpanel::ApacheConf  
    <IfModule mod_suphp.c>  
        suPHP_UserGroup amitabh amitabh  
    </IfModule>  
    <IfModule !mod_disable_suexec.c>  
        SuexecUserGroup amitabh amitabh  
    </IfModule>  
    ScriptAlias /cgi-bin/ /home/amitabh/public_html/cgi-bin/  
    SSLEngine on  

    SSLCertificateFile /etc/ssl/certs/my-own-website.com.crt  
    SSLCertificateKeyFile /etc/ssl/private/my-own-website.com.key  
    SSLCACertificateFile /etc/ssl/certs/my-own-website.com.cabundle  
    CustomLog /usr/local/apache/domlogs/my-own-website.com-ssl_log combined  
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown  
    <Directory "/home/amitabh/public_html/cgi-bin">  
        SSLOptions +StdEnvVars  
    </Directory>  

    # To customize this VirtualHost use an include file at the following location  
    # Include "/usr/local/apache/conf/userdata/ssl/2/amitabh/my-own-website.com/*.conf"  

</VirtualHost>

I posted the same question in a linux forum.

share|improve this question
Yea, no. You haven't provided near enough technical information to tell us what systems you are using. – Brent Pabst Oct 9 '12 at 17:22
When you say that it "redirects to the main domain", do you mean the URL in the browser changes or that you just get the wrong content? Please provide the relevant parts of your Apache config. – Shane Madden Oct 9 '12 at 17:23
@ShaneMadden Thanks. yep, "redirecting" is the wrong word. The url remains unchanged. The content is wrong and is the content from the main site. Fetching the apache config – Amitabh Oct 9 '12 at 17:31
Can you also provide the output from apachectl -S? – Shane Madden Oct 10 '12 at 3:10
I wonder if your virtualhost configuration for https is incomplete and it's serving from the fist virtualhost as the default? – Colin 't Hart Oct 10 '12 at 9:07
show 4 more comments

closed as not a real question by Brent Pabst, MadHatter, mdpc, Adrian, Ward Oct 24 '12 at 5:46

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.