Answer the question
In order to leave comments, you need to log in
How to remove double redirect?
Is it possible to somehow remove the double redirect from index.php/index.html pages. Redirects from other pages in one step, and from these in two steps:
For example, go to https://www.example.com/index.html
First, redirect to htр://www.example.com/
And then to https: //example.com/
Now these are the rules in htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule (.+)\.html?$ https://example.com/$1/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www.example\.com [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question