I’m writing a front-controller that will handle page requests, by parsing
$_SERVER['REQUEST_URI'].
I would like to get all requests routed to /index.php
Some examples as follows:
example.com/page2?foo=bar
example.com/page2/?foo=bar
example.com/page/action/123/
example.com/page/action/123
What is the regexp rule that i have to write in .htaccess ?
And do I need an extra rule so that example.com/images/ directory would work as ‘normal’ directory?
You could try something like this :