apache htaccess mod_rewrite允许访问特定目录

时间:2014-09-18 15:27:30

标签: php apache .htaccess mod-rewrite

我有一个包含以下.htaccess文件的子域名:

Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

这是一个标准的symfony1.x(php框架)htaccess文件。我添加了一个abc目录,但是当我想在浏览器中查看它时,我被重定向到index.php。我应该在.htaccess文件中添加什么来让我查看abc目录并单独保留所有其他重定向?

1 个答案:

答案 0 :(得分:0)

RewriteEngine On行下面添加此规则:

# ignore all below rules for abc directory
RewriteRule ^abc(/.*)?$ - [L,NC]