Skip to content

Instantly share code, notes, and snippets.

@EastSideCode EastSideCode/.htaccess
Last active Mar 13, 2019

Embed
What would you like to do?
Force HTTS and www
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.