Skip to content

Instantly share code, notes, and snippets.

@joostvanveen
Last active April 22, 2021 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joostvanveen/66ce516eaeefec41d345 to your computer and use it in GitHub Desktop.
Save joostvanveen/66ce516eaeefec41d345 to your computer and use it in GitHub Desktop.
Force SSL in .htaccess
# 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]
@robyirloreto
Copy link

Thank u brother

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment