Skip to content

Instantly share code, notes, and snippets.

@Neolot
Created January 13, 2017 18:15
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 Neolot/4b4d31fa0f9136b080703b827f6d6bfc to your computer and use it in GitHub Desktop.
Save Neolot/4b4d31fa0f9136b080703b827f6d6bfc to your computer and use it in GitHub Desktop.
APACHE Redirect http to https and www to non-www
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment