Hi folks, I want to feed all document requests in a folder through to PHP where I can then manage user permissions to check if the user has access rights to the document. DirectoryIndex ../ RewriteEngine On RewriteRule ([.]*) doc_manager.php?file=$1 Here is my current htaccess which as you can see is quite basic. What I need is the document not to actually open as well rather just have the file name fed through to doc_manager.php. Please can you tell me what I'm missing. Thanks A
Yes - thats exactly what I need it to do, or a PDF or even image - any file gets forced through my script.
I'm going to assume your rewrite code works and that the documents are being opened/downloaded by the browser? what im thinking is that you need to deny access to the file types accept for 127.0.0.1 and then allow the server to open and send the file to the doc_manager
Hi, Thanks for your response! How would this look in a htaccess file? I'm no guru at htaccess I'm afraid. A
RewriteEngine On RewriteRule ^(.*)$ doc_manager.php?file=$1 [L] Should not open the files, it should make all requests use doc_manager.php?file=file.extension But doc_manager.php , .htaccess and the files should all be in the same folder. Please tell me how these 3 parts are organized relating to each other.