From 3f995330eef2e2628ca7b92d514905be4650ac75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=9C=D0=B0=D0=BA?= =?UTF-8?q?=D1=81=D0=B8=D0=BC=D0=BE=D0=B2?= Date: Sat, 20 Jul 2024 07:47:30 +0000 Subject: [PATCH] GP | feat: add .htaccess --- .htaccess | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..f092658 --- /dev/null +++ b/.htaccess @@ -0,0 +1,14 @@ + + # Редирект: ...// -> .../ + 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] + \ No newline at end of file