Answer the question
In order to leave comments, you need to log in
There are slashes after the file name in the URL. How to fix?
Hey!
Apache + nginx server.
There is a file site.ru/file.php
I noticed that it is available at this address: site.ru/file.php/
And at this: site.ru/file.php/blablabla.
Thousands of similar garbage pages have flown into the Yandex index.
There is nothing suspicious in .htaccess.
I can't figure out how to disable such URLs.
Tell me which way to look? Thank you.
Answer the question
In order to leave comments, you need to log in
If they got into the Yandex index, respectively, where did the links come from? Yandex does not invent links by itself, as it seems to me. Accordingly, you need to look for the root cause of their occurrence (such as "left" links on the site)
Further, if you use php files directly in addressing, I recommend disabling mod_rewrite (or another similar module), and the problem will disappear by itself.
If rewriting is still needed, I would recommend figuring out the system, why does it suddenly issue pages (and their duplicates) at non-existent addresses, instead of errors (404 for example)?
After bringing the engine in order, you can prohibit (or vice versa add) slashes at the end of the address. How to remove slashes at the end, discussed for example here. I am sure that there is a fairly large amount of similar information on how to add these slashes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question