duanjian3920 2016-06-03 19:04
浏览 86

拒绝通过mod_rewrite规则访问目录和文件不起作用

I have my .htaccess file with this code:

RewriteEngine On
RewriteRule ^(include/|core/).*\.(php|db)$ - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

It works great but only on my WAMP server... When I use this rules on some web servers I have still access to files in include and core directories.

When I remove

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

it works again. What I'm doing wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?