shadedecho
Programmer
Inside of a perl CGI script (run through mod_perl on Apache), I want to be able to inspect a URL and based on certain conditions, either decide to allow the requested file or alternately respond with some other behavior (like a 404 or whatever).
So, essentially, I have a .htaccess file routing all my requests to one perl script, and I want that perl script to be the gateway that decides if a certain file is ok to request or not.
The catch is, when I want to allow the file to be requested (like a .html file for instance) I don't want to have to sniff/guess the content-type and then open the file and echo the contents. I just want to signal to Apache to serve the file as normal (via just a normal internal redirect).
I do not want a regular 301 redirect that the browser will be notified about, I want an internal redirect so the user/browser don't know the difference.
So, essentially, I have a .htaccess file routing all my requests to one perl script, and I want that perl script to be the gateway that decides if a certain file is ok to request or not.
The catch is, when I want to allow the file to be requested (like a .html file for instance) I don't want to have to sniff/guess the content-type and then open the file and echo the contents. I just want to signal to Apache to serve the file as normal (via just a normal internal redirect).
I do not want a regular 301 redirect that the browser will be notified about, I want an internal redirect so the user/browser don't know the difference.