htaccess添加重定向异常RewriteRule

时间:2013-12-04 20:26:25

标签: regex apache .htaccess mod-rewrite

这是我的htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

我想要做的是在我尝试打开它时,为文件夹统计添加一个例外,它不会将我重定向到主页。 有什么建议/帮助吗?

1 个答案:

答案 0 :(得分:1)

  

I am trying to do is to add an exception for the folder stat

您可以尝试以下规则:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !(public|stat)/ [NC]
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>