Hi Guys,
So I've recently bought and installed a wildcard SSL on my server which governs domain.com and any subdomain that I add to it.
In essence, the cert works fine. For example, if I set up a static 'hello world' PHP page and set the domain to sub1.domain.com, the page is displayed in both HTTP and HTTPS (with some mod_rewrite which I'll come to shortly).
The issue is that the domain is serving applications, which all kind of need their own document root to function properly.
If I print_r the $_SERVER array outside HTTPS, I see the correct document root - something like:
/home/domain.com/public_html/_apps/sub1/
That would be the doc root for sub1.domain.com
If I then switch over to HTTPS and again, print_r the $_SERVER array, I get:
/home/domain.com/public_html
It seems to be completely ignoring the docroot for that subdomain. The current mod_rewrite I'm using in the docroot of the base domain is:
Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} ^sub1\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/_apps/sub1/
RewriteRule ^(.*) /_apps/sub1/$1
This is required to get the wildcard SSL working across multiple subdomains. Without this, switching to SSL just reverts to the base domain.
Does anybody know if/how I can maintain the document root from normal HTTP inside HTTPS and stop it changing the document root to that of the base domain when running through HTTPS?
Cheers
Pete