捕获所有的.htaccess - 只有当什么也没有发现之前 [英] Catch all .htaccess - only if nothing is found before
问题描述
时有可能有例外,一个包罗万象的所有正则表达式中的.htaccess文件?
Is it possible to have exceptions to a catch all regex in a .htaccess file ?
下面是我目前的.htaccess文件
Here is my current .htaccess file
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ see.php?url=$1 [L]
我想有一些例外的捕获所有的正则表达式,并只使用它在后一种情况下,如果没有被发现之前
I would like to have some exceptions to the catch all regex and only use it in the last case, if nothing is found before.
我试着用的RewriteCond玩,但我没能完成这项工作。
I tried to play with RewriteCond, but I weren't able to make this work.
编辑:我想异常被rewrited为好,它本可以
I would like exceptions to be rewrited as well, it this possible ?
推荐答案
任何你在.htaccess文件将捕获所有的重写将首先执行之前。所以,如果你把一个[L]标志,对这些重写则处理停止那里的渔获全部重写,将不会触发。
Anything you place in the .htaccess file before the catch all rewrite will be executed first. So if you put an [L] flag on those rewrites then the processing stops there and the the catch all rewrite will not fire.
有意义吗?
这篇关于捕获所有的.htaccess - 只有当什么也没有发现之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!