V
V
Vladimir Atamanov2015-07-25 16:20:33
Apache HTTP Server
Vladimir Atamanov, 2015-07-25 16:20:33

How to compose (configure) RewriteCond for .htaccess?

Good day everyone!
Please help me compose a RewriteCond for .htaccess
, how to do it so that at the end of the address index.php is removed (if it exists), example:

sitename.ru/.../index.php >> sitename.ru/.../
sitename.ru/index.php >> sitename.ru

after that there should be a redirect to the input file
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmitryim, 2015-07-26
@dmitryim

Try adding the following rule at the beginning:
RewriteRule ^(.*/)index\.php(.*) /$1$2 [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question