【发布时间】:2014-07-24 15:04:42
【问题描述】:
我试图让 Apache mod_rewrite 忽略某些目录。这是我的 httpd.conf 的一部分:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(img|css|js)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
如果我去http://example.com/img/random_path,我仍然看到index.php生成的错误信息(而不是默认的错误页面)。
【问题讨论】:
-
/img/中也有 .htaccess 吗? -
使用跳过标志
S=1避免下一条规则
标签: apache .htaccess mod-rewrite