A
A
Alexey Ivanov2019-06-05 17:15:08
htaccess
Alexey Ivanov, 2019-06-05 17:15:08

How to remove index.php from url?

Good afternoon. The site uses Stalker cms. And such a problem that there is a duplication of pages by adding index.php to the url.
The second day I suffer, I don’t know what to write in .htaccess to make a redirect. Does anyone know and can help?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Nikolaev, 2019-06-05
@nikolaevevge

And if at the top of the php executable file referenced by rewrite write like this? (But this is without htaccess edits)
<?php
if (strpos("index.php",$_SERVER["REQUEST_URI"]) !== false) {
header( "location: ".str_replace("index.php","",$_SERVER["REQUEST_URI"]),301,true);
exit;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question