S
S
Sergey Rybakov2017-05-31 23:12:45
PHP
Sergey Rybakov, 2017-05-31 23:12:45

Why does $_SERVER['REQUEST_URI'] return /index.php?

$_SERVER['REQUEST_URI'] always returns /index.php.
for example, given a request
site.ru/test
and $_SERVER['REQUEST_URI'] instead of /test returns /index.php,
site/index.php/test instead of /index.php/test $_SERVER['REQUEST_URI'] returns /index. php

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2017-05-31
@kyctarnik

Probably the webserver overrides.
If you have a perversion in the form of nginx proxying to apache, then it is better to call php-fpm directly from nginx.

T
ThunderCat, 2017-05-31
@ThunderCat

by the fact that uri is a request resource, and all requests end with index.php, everything behind it is QUERY_STRING, that is, parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question