Hi,
I'm using Apache1.3.xx and php 1.4.xx and have developed a fairly large site. Large portions of this site are protected, so i have written a large security module stored at /security.php, i then created an apache rewrite rule stating "Send everything through /security.php"
RewriteEngine On
RewriteRule (.*) security.php
The module works great but the problem is it is SLOW. This is because after the page is validated as "can be hosted" it is now up to security.php to host these files.
For "text/html" files i just include them, but for binary files (images, zips, exe's) i have to fopen them, and stream the bytes out to the browser. This accounts for about 75% of the of the security.php code. My question is, after validation of a page, can I pass control BACK to apache so it can host it FAST like apache does?
Pitfalls i've hit are once the header is sent to security.php, control now resides there and any redirecting through header("Location: ") hits the rewrite rule and we have infinite redirecting.
Perhaps rewrite isn't what i even want to use? All i need to do is pre-pend some security code to EVERY file hosted.
Thanks in advance
-Dave