Setting up a PHP Filter for a Directory Alias
Published July 11th, 2009I wanted to to have a PHP script fire every time someone went to a specific URL which was not a real directory so I came up with a simple Apache configuration to deal with this scenario. Here is an example of such a configuration:
<Location /start>
SetHandler start-app
Action start-app /start.php virtual
</Location>
When a user visits http://server/start/here or http://server/start/there etc. the /start.php script found on the document root runs. In the script, I can then determine what file is requested by taking a peet at the REQUEST_URI and deal with the file request accordingly.
Just thought I share this little tip for you!
Enjoy.
Kabir
Leave a comment
Comment Policy: First time comments are moderated. Please be patient.
You must be logged in to post a comment.