LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Allow only ssl, https:// not http:// on apache2 webserver, Linux (https://www.linuxquestions.org/questions/linux-server-73/allow-only-ssl-https-not-http-on-apache2-webserver-linux-634746/)

therapeias 04-11-2008 03:13 PM

Allow only ssl, https:// not http:// on apache2 webserver, Linux
 
I'm new to posting, will try to be brief. Apache has been configured on Linux, certs are working, relatively simple implementation for 1 website. System uses httpd.conf file for port 80 reference, httpd-ssl.conf file for ssl, namely port 443. Have been surfing, have found many references to include "RedirectPermanent / https://my.server.net/" within the httpd.conf file, but this doesn't work (still can access the site with both http:// and https://). Any help would be appreciated, thanks!

p_s_shah 04-11-2008 04:03 PM

May be you should try this :

Link : http://www.cyberciti.biz/tips/howto-...nnections.html
Quote:

.htaccess File :
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Make sure you have something as follows in httpd.conf (mod_rewrite support):
LoadModule rewrite_module modules/mod_rewrite.so


All times are GMT -5. The time now is 08:18 PM.