Tuesday, April 18, 2017

Forcing HTTPS

This is how to force HTTPS in either .htaccess or httpd.conf (e.g., /etc/httpd/conf):


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

OR

# RewriteEngine On
# RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# RewriteCond %{HTTPS} !=on

# RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


$ service httpd restart


To force selectively on URL paths view this thread..

No comments:

Post a Comment

The source code for gliesians.com is for sale on Ebay.

I've decided to shut down gliesians.com and sell the source code. If anyone is looking to purchase the related source, you can find it...