Forum Moderators: phranque
Here is what I have so far:
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.php$ $1. [R=permanent]
This seems to render all php files totally inaccessible. But I have some php files in a folder /login/index.php that I want to work. Is there a way to allow php files in the login folder to work?
Also, it would be cool to set this globally but only allow certain file types to function normally. For example, so that I could set .jpg files to exclusively work. I'm stuck on this although I'm sure it's easy.
Hope all that makes sense, Thanks
Matt :)
Welcome to WebmasterWorld!
Yes, the question is a bit fuzzy... But I'll have a go.
You can accomplish file blocking more effectively using the standard approach:
RewriteRule \.php$ - [F]
If you want to add exclusions, then use RewriteCond:
RewriteCond %{REQUEST_URI} !^/login/index\.php$
RewriteRule \.php$ - [F]
Jim