How to do different operations in PHP depending on the url structure
<p>I have an index.php file which I would like to serve different content based on the url structure.</p>

<p>For example. If the url is mysite.com/index.php/folder1 I run a certain query and display the results and if the url is mysite.com/index.php/folder2, run a different query.</p>

<p>The solution also has to work for mysite.com/folder1 etc (ie index.php omitted).</p>

<p>And it would be ideal if the same approach could be extended to mysite/com/folder1/category1 etc. Note, GET variables aren't desired here.</p>
