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.
apachectl -S? – Shane Madden Oct 10 '12 at 3:10