I have url to index.php like this
http://localhost/exercise/
When I call
return var_dump(
trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/')
);
I have exercise
project folder in xampp's htdocs.
On url http://localhost/exercise/sd/ds
I get exercise/sd/ds
How to get rid of that folder name in request_uri? Or any other (if there would be) folders if this php script was nested in some many folders.
How to get Request_URI started from this point where script is?
host/exercise
and you want to get/math/lesson1
whenhost/exercise/math/lesson1
is requested?page
when I am onhost/exercise/page
, notexercise/page