Is there any .htaccess rule that checks if requested file does not exist in “mydir” and get index.php?get=mydir
I tried this but not working:
RewriteCond mydir/%{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ /index.php?get=$1 [L]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using Apache, I would suggest using this:
http://httpd.apache.org/docs/2.0/mod/mod_actions.html
This may not be the best approach but it works for me.
Basically you will setup a script that Apache will send all requests through.
Each time a html file is requested, Apache will run handler.php.
Inside
handler.php, you can use$_SERVERto determine the requested file, check if it exists and include it if it does exits. If it doesn’t exist, do whatever you need to do.