well i think you could actually do this with php by a simple condition. But i have not done this, it is mostly theory on my end. But you must have a apache rewrite rule to re-direct all request to the index. then once the request hits the index immediately grab the url with $_SERVER and run a quick check condition on it. Based on that condition(if url is a do this else is b do this ) then the rest could be functions writting rules or use php file operations.