N
N
Nikita Souvel2016-04-28 15:49:52
htaccess
Nikita Souvel, 2016-04-28 15:49:52

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

1 answer(s)
V
Viktor Taran, 2016-04-28
@Souvel1

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.

Something like that?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question