V
V
vadimstroganov2015-10-07 12:24:30
htaccess
vadimstroganov, 2015-10-07 12:24:30

How to make such a redirect in htaccess?

Hello!
Tell me how to make a 301 redirect from site.ru/index.php/{any text} to site.ru
or
site.ru/index.php/{any text} to site.ru/category/index.php/{ any text} on site.ru/category

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
noname90, 2015-10-07
@noname90

www.generateit.net/mod-rewrite/index.php

S
ShamblerR, 2015-10-08
@ShamblerR

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 question

Ask a Question

731 491 924 answers to any question