Created
May 24, 2023 10:33
-
-
Save devig/f704598693df8ec5ef00b56ab9f67d8c to your computer and use it in GitHub Desktop.
htaccess redirect www to non-www https and from index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
RewriteCond %{ENV:HTTPS} !on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
RewriteEngine On | |
#Если у Вас переход на index.html: | |
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ | |
RewriteRule ^index\.html$ https://site.com/ [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment