Jump to content

How to confine users to https:// instead of http:// urls


turtleman8605

Recommended Posts

I have an SSL certificate installed on a site and I want to make it impossible for someone to access the site without the cert. In otherwords, if someone were to type in http:// I want it to be changed to https:// automatically. Can someone advise on this? thanks.

On one of my servers, I do the same with the following in my httpd.conf:

 

<VirtualHost *:80>
        ServerName www.hostname.com
        Redirect / https://www.hostname.com/
        SSLEngine off
</VirtualHost>

<VirtualHost *:443>
//All my Config/SSL stuff here
</VirtualHost>

I would recommend doing the same as the above poster. Setup a virtualhost pointing to port 443 and redirect your port 80 traffic to it. can be done with a copy/paste and one line in a config file, rather than several lines of probably sloppy php code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.