turtleman8605 Posted March 31, 2008 Share Posted March 31, 2008 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. Link to comment https://forums.phpfreaks.com/topic/98851-how-to-confine-users-to-https-instead-of-http-urls/ Share on other sites More sharing options...
rhodesa Posted March 31, 2008 Share Posted March 31, 2008 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> Link to comment https://forums.phpfreaks.com/topic/98851-how-to-confine-users-to-https-instead-of-http-urls/#findComment-505801 Share on other sites More sharing options...
svalding Posted March 31, 2008 Share Posted March 31, 2008 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. Link to comment https://forums.phpfreaks.com/topic/98851-how-to-confine-users-to-https-instead-of-http-urls/#findComment-505819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.