GP | feat: add .htaccess

This commit is contained in:
maksim committed 2024-07-20 07:46:52 +00:00
1 parent 4961f2b1c9
commit b1afb0f09c
1 file changed
+14
+14
View File
@@ -0,0 +1,14 @@
<IfModule mod_rewrite.c>
# Редирект: ...// -> .../
RewriteCond %{REQUEST_URI} (.*)\/\/$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/%1/ [R=301,L]
# Редирект: с www -> без www
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# Редирект: HTTP -> HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>