Answer the question
In order to leave comments, you need to log in
How to remove the .php extension at the end of a line in .htaccess?
You need to redirect to the page:
site.ru/login
In the following cases:
site.ru/login.php,
site.ru/login.html
site.ru/login/index.php
I try this:
RewriteRule ^(.*)/.html$ /$1 [L,R=301]
RewriteRule ^(.*)/.php$ /$1 [L,R=301]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteCond %{REQUEST_URI} ^(.*)/index\.php$
# URL cодержит index.php в конце.
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question