Skip to content

Instantly share code, notes, and snippets.

@uovidiu
Created May 13, 2019 16:06
Show Gist options
  • Select an option

  • Save uovidiu/ffe9d60414d99c0893b7c3192fde81e5 to your computer and use it in GitHub Desktop.

Select an option

Save uovidiu/ffe9d60414d99c0893b7c3192fde81e5 to your computer and use it in GitHub Desktop.
Canonical https/www
# Canonical https/www
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule (.*) https://www.%1/$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment