Reputation: 1033
Ok here's my issue I have a file that is delivered through https, all the files on my server have a common header.php file that is included within files. In the header file i have all my stylesheets etc called from my cdn folder. http://cdn.domain.com since they are called http in my https file (via header.php) it doesnt transmit fully in https.
Is there a way to have htaccess make all transactions on a https page via https even if it is trying to get the http version ? Or is my best bet to coding it in the PHP?
Thanks
Upvotes: 0
Views: 610
Reputation: 10781
This isn't really a server configuration issue. What you need to do is ensure that the server is returning "https" for the location of all of your external resources (css, javascript & images).
Your best bet with a common header file is to use relative urls (no http(s)://example.com/) and let the browser determine the protocol that should be used.
If the css et al are on a different domain, then I'd just detect the protocol being used and massage the protocol in your html before returning it to the user.
Or you can just use HTTPS everywhere ;0)
Upvotes: 1
Reputation: 66405
Just remove http: from all your URL's. It will use http or https depending on what protocol the webpage is using.
Upvotes: 0