Answer the question
In order to leave comments, you need to log in
Why does the server add a slash to the address?
I use a server on CentOS 7.3.1611.el7.centos (x86_64) with ISPmanager.
ran into an unexpected problem: I need to accept a POST request that sends to site.ru/post. I put the index.php file in the /post folder, and when I open site.ru/post myself, the file works fine (makes a record in the database), but the file does not respond to requests from the external structure.
I saw in the access.log that, firstly, when I open site.ru/post, I first receive a 301 response, I am redirected to site.ru/post / , and only then I get status 200. If I immediately open site.ru/ post/, then everything is fine.
and the external request is simply redirected (because there is no slash either) and that's it.
I disabled SSL, disabled PHP, even created a new domain initially without any PHP - anyway, the server always adds a slash.
the exception is the opening of the main page, then, on the contrary, the slash at the end is removed.
on the ispmanager forum they said that nginx does this, but I have it disabled.
what could it be that adds a slash?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question