Answer the question
In order to leave comments, you need to log in
Why doesn't httacces redirect work correctly in Yii2?
It is necessary that on the main index.php be transferred to the main domain and pages with a slash are redirected without a slash. Here is my
htaccess:
RewriteEngine on
Options +FollowSymLinks
RewriteBase /
RewriteRule . index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP
RewriteRule ^index\.php$ https://site.ru/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
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