Last active
August 10, 2021 06:41
-
-
Save daubac402/691fb8acdfcd85971cf631e40dd7d1a7 to your computer and use it in GitHub Desktop.
Force redirect from http to https (editing your .htaccess OR your .conf)
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
# edit .htaccess way | |
<IfModule mod_rewrite.c> | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
</IfModule> | |
# edit .conf way (add into <VirtualHost *:80) | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment