Remove from the section name /index.php
For example, the page http://site.ru/razdel/index.php
It is required to redirect to http://site.ru/razdel/
Remove from the section name /index.php
For example, the page http://site.ru/razdel/index.php
It is required to redirect to http://site.ru/razdel/
Like that
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^/?razdel/?$ /razdel/index.php [L] </IfModule> If the address to which the appeal ends ends at index.php or index.html, then we redirect:
RewriteEngine On RewriteCond %{REQUEST_URI} ^(.*)/index\.(php|html)$ RewriteRule .* http://site.ru%1/ [R=301,L,QSA] RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L] Just remember to enable mod_rewrite in PHP
Source: https://ru.stackoverflow.com/questions/596928/
All Articles