dzenlife
4/3/2018 - 10:44 AM

Redirect Htaccess

index.php to /

RewriteCond %{REQUEST_URI} ^(.*)index\.php$
RewriteCond %{THE_REQUEST} !bitrix/*
RewriteRule ^ %1 [R=301,L]
Redirect 301 /news/1/ /news/2/
RewriteCond %{THE_REQUEST} ^.*/index\.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L] 
#https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ https://%{HTTP_HOST}/$1/ [L,R=301]