Force http requests to the same location but securely using https with .htaccess file
user@server:/var/www/directory# cat /var/www/directory/.htaccess
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?directory/(.*) https://%{SERVER_NAME}/directory/$1 [R,L]
# This rule will redirect all users who are using any part of /directory/ to the same location but using HTTPS.
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?directory/(.*) https://%{SERVER_NAME}/directory/$1 [R,L]
# This rule will redirect all users who are using any part of /directory/ to the same location but using HTTPS.
Comments
Post a Comment