This is my url:
http://localhost/framework/index.php
echo $_SERVER['REQUEST_URI'];
Would output: /framework/index.php
But If my url was:
The output would be:
/framework/
And If I move the file, yeah you get the idea.
How do I grab the content after folders/eventually index.php file? My idea is to have index.php as a front controller.
If I have:
http://localhost/framework/index.php/test/test
I only want the test/test part.
http://localhost/framework/test/test
I only want the test/test part.
You can automatically detect the base uri and remove it, leaving you with the test/test part.
Edit: mAu’s comment above is correct. I was under the assumption you was already using mod rewrite.