JamesB Posted December 13, 2012 Share Posted December 13, 2012 (edited) Hi! Is it possible to have a htaccess file check if the filename in the URL, exists in a certain folder on the server? I have this URL:http://127.0.0.1/mywebsite/directions Which should check if this file exists:<root>/mywebsite/Templates/Pages/directions.php If it doesn't exist, a 404 should be given. I have this code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond /Templates/Pages/%{REQUEST_FILENAME}.php !-fRewriteRule (.*) - [L,R=404] </IfModule> But it's currently giving a 404 on all pages. Edit:The .htaccess file is at:<root>/mywebsite/.htaccess Edited December 13, 2012 by JamesB Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now