Hey all,
I'm having a bear of a time locating any information on how PHP might
handle URL filtering and dispatching.
For example, let's say I have a web site where I have one main PHP
script that examines all URLs and sends the request to an appropriate
other script to handle.
www.example.com/this/is/a/long/url
I want all paths at example.com to be handled by one PHP script. That
script should receive the request above, and any other. Then that
script looks at the path information, and decides that long_url_path.php
is the script to handle it, and dispatches (or just calls)
long_url_path.php.
Note I want a server side dispatch, not client side redirect. I don't
want to use HTTP status 300's please.
Buried is my question is concerns about security. How do I stop users
from calling scripts directly when they should have no access to that
script? I'd like to hide the path information, as well as prevent them
from ever even guessing the path (by typing random strings in the path
portion of the URL for example, ie. a brute force attack).
Any pointers? I'll take an "RTFM" if it's accompanied by a link to the
appropriate section of the FM. ;)