Skip to content

Instantly share code, notes, and snippets.

@amorkovin
Last active September 5, 2019 06:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amorkovin/7586e3b83d89c129e07997f425de2061 to your computer and use it in GitHub Desktop.
Save amorkovin/7586e3b83d89c129e07997f425de2061 to your computer and use it in GitHub Desktop.
www и ssl редиректы для htaccess
-------С www на не-www-------
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www.sdelaysite\.com$ [NC]
RewriteRule ^(.*)$ https://sdelaysite.com/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://sdelaysite.com/$1 [R=301,L]
-------С не-www на www-------
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^sdelaysite\.com$ [NC]
RewriteRule ^(.*)$ https://www.sdelaysite.com/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://www.sdelaysite.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment