How to remove index.php from the url?

Good afternoon. The website uses the Stalker cms. And a problem, that duplicate pages by adding a index.php in the url.

The second day I suffer, don't know what to write in .htaccess to do a redirect. Maybe someone knows and can help?
March 23rd 20 at 19:14
1 answer
March 23rd 20 at 19:16
But if at the top of the executable php file referenced in the rewrite to write this?(but no edits to htaccess)

if (strpos("index.php",$_SERVER["REQUEST_URI"]) !== false) {
header("location: ". str_replace("index.php","",$_SERVER["REQUEST_URI"]),301,true);
exit;
}
Just probably not "index.php"and "/index.php". - trinity97 commented on March 23rd 20 at 19:19
@trinity97, it index.php

Look was domen.ru/vasya/index.php?st=gm will be domen.ru/vasya/?st=gm
If /index.php it domen.ru/vasya/index.php?st=gm will be domen.ru/vasya?st=gm (and there is a mistake, as John is a "folder" and not the "controller folder") - Gabriel.Huds commented on March 23rd 20 at 19:22
didn't work.. no effect - Jalen_Schmeler1 commented on March 23rd 20 at 19:25
Check this(for addresses containing index.php of course):
var_dump(str_replace("index.php","",$_SERVER["REQUEST_URI"]));exit;

Write a review what is the result of var_dump returned and what address You requested - Gabriel.Huds commented on March 23rd 20 at 19:28
5cf8f4e00b2a8344882955.png - Jalen_Schmeler1 commented on March 23rd 20 at 19:31
Damn, I understand You have a joomla nedostroen CNC was.
You need to start .htaccess <= here in this format to rename then in the settings panel there that is already the type to remove index.php (that is, there is one setting is responsible for CNC and the other for revrite I cannot remember how, 2 years ago, climbed in joomla the last time)

Here and about the script for Your case would look like this : index.php/ the slash after it index.php - Gabriel.Huds commented on March 23rd 20 at 19:34
About the inclusion of something in the panel - see on Your website that already works(the domain was in the screenshot), so You simply edit the script with what to write there index.php/ - Gabriel.Huds commented on March 23rd 20 at 19:37
@Gabriel.Huds, and slash did not work(((
I had all the redirects in htaccess to register hands.. well, not a lot of pages

not joomla. STALKER CMS. In laravel. Probably with some add-on - Jalen_Schmeler1 commented on March 23rd 20 at 19:40
@Jalen_Schmeler1, it is strange that did not happen. 10 times I did and all the way through.

I understand the issue You chose? - Gabriel.Huds commented on March 23rd 20 at 19:43
@Gabriel.Huds, Yes, the problem was solved. Thanks for the help!) - Jalen_Schmeler1 commented on March 23rd 20 at 19:46

Find more questions by tags htaccess