Skip to content

Instantly share code, notes, and snippets.

@kennyLtv
Last active February 26, 2018 17:26
Show Gist options
  • Save kennyLtv/12c8813de571755083d6d35df0ac8e63 to your computer and use it in GitHub Desktop.
Save kennyLtv/12c8813de571755083d6d35df0ac8e63 to your computer and use it in GitHub Desktop.
HTTPS && www -> non www
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%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