Last active
April 22, 2021 20:12
-
-
Save joostvanveen/66ce516eaeefec41d345 to your computer and use it in GitHub Desktop.
Force SSL in .htaccess
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
# Force SSL, but only for a certain domain | |
# At the same time, redirect http non-www ad www to https://www | |
# Replace example\.com and example.com with your domain | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ | |
RewriteRule (.*) https://www.example.com/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank u brother