Skip to content

Instantly share code, notes, and snippets.

@Scordavis
Forked from amorkovin/ssl-notwww-to-www.txt
Created November 1, 2018 20:26
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 Scordavis/55bb3645a17ef92819993c1f63525c71 to your computer and use it in GitHub Desktop.
Save Scordavis/55bb3645a17ef92819993c1f63525c71 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