A
A
Alexander2016-12-13 18:02:21
Apache HTTP Server
Alexander, 2016-12-13 18:02:21

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

1 answer(s)
E
Evgeny Volf, 2016-12-13
@Wolfnsex

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 question

Ask a Question

731 491 924 answers to any question