Mod_Rewrite - 如果存在.php扩展名,则跳过规则

时间:2009-06-29 21:30:05

标签: php mod-rewrite

如果网址中存在.php扩展名,我无法找到跳过下一条规则的方法

这是我目前正在使用的

RewriteCond %{REQUEST_URI} !\.php
RewriteCond %{REQUEST_URI} \/([0-9a-z]*)$ [NC]
RewriteRule ^(.*) index.php?un=$1 [L]

1 个答案:

答案 0 :(得分:2)

您的问题有点含糊不清,但以下内容可能会有所帮助。它为下一个重写规则添加了一个条件,因此只有在请求URI中没有出现.php时才会对其进行评估。

RewriteCond %{REQUEST_URI} !\.php
RewriteRule  # Your rewrite rule here
相关问题