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

OXY 3 Parts Needed

This blog post lists the parts needed to build and operate an OXY 3 .... but first an Oxy 3 unboxing video! Lynx OXY3-255 - Oxy 3 H...