Created
July 6, 2017 00:58
-
-
Save valeriu/9f61a60a5689caa13102d62dc0547fef to your computer and use it in GitHub Desktop.
http to https
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect http to https .htaccess | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{ENV:HTTPS} !=on | |
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] | |
# Redirect http to https apache | |
<VirtualHost *:80> | |
ServerName www.example.com | |
Redirect / https://www.example.com/ | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName www.example.com | |
# ... SSL configuration goes here | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment