I am having an issue with a site in that it seems like my htaccess file (situated in web root) is preventing access to any php files in subdirectories. I’ve tested this by creating a new test folder and adding a php file to it which does a simple echo. I always get a 500 error.
This issue only recently started happening. The htaccess rules I have are the same as many other sites I run on my own server, however this one site is hosted by a different company. Does anyone know why this could be happening? Could a change on the server have caused this possibly?
This is my htaccess file:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
# Turn on URL rewriting
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/kohana/, use /kohana/
# If your URL is www.example.com/, use /
RewriteBase /
# Protect application and system files from being viewed
RewriteCond $1 ^(app_admin|app_public|system)
# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
# Do not enable rewriting for other files that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
Options -Indexes
See this discussion from ServerFault. It’s definitely a permissions issue. Per that discussion, make sure the parent folders also have the proper permissions or Apache can’t descend into the folder with the .htaccess file to read it.