Skip to content

Instantly share code, notes, and snippets.

@Edwardtonnn
Created November 22, 2019 20:13
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 Edwardtonnn/9ee4b785f8dd8400fd91fecf634ca413 to your computer and use it in GitHub Desktop.
Save Edwardtonnn/9ee4b785f8dd8400fd91fecf634ca413 to your computer and use it in GitHub Desktop.
htaccess rewrite
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