im trying to solve this issue. I have a web site with this simplified struture:
mysite.com/index.php
mysite.com/faq.php
mysite.com/url.php
mysite.com/users/some_content_here
If the user call the index page or the faq page they have to arrive to that pages. BUT if the user writes something like mysite.com/xgsfd (or any other string different than index or faq) they have to call the url.php wich recive the xgsfd string via GET and redirects the user to a particular page.
The url.php script is already done, but i have no idea how to solve the other part, im was thinking using a .htaccess file in the root directory but as you can see it will trigger a infinite loop of rederictions.
Any idea how to solve this issue? Thanks for any help!
You can use rewrite conditions to serve files, folders and symlinks if they actually exist, but otherwise rewrite to the url.php:
That way requests to faq.php or index.php will be served, while a request to mysite.com/xgsfd will end up rewritten to url.php?url=/xgsfd .