Answer the question
In order to leave comments, you need to log in
How to make an htaccess mod_rewrite redirect?
I work with CodeIgniter, the question arose with setting up links that are correct in every sense, incl. SEO,
slash problems, index.php eliminated, but the fact (for example)
example.local/login/index = example.local/login
Is the same page available anyway?
Maybe someone can share their settings file specifically for this framework, who asked the same question?
Answer the question
In order to leave comments, you need to log in
Guys, well, honestly, why Google is not destiny, well, it is searched for in general in 1 second.
############################################################################
#### Убираем index.php, если он есть в конце URL ####
############################################################################
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