【发布时间】:2012-04-08 04:19:06
【问题描述】:
.htaccess 文件中的 catch all regex 是否可能存在异常?
这是我当前的 .htaccess 文件
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ see.php?url=$1 [L]
我想对 catch all 正则表达式有一些例外,并且只在最后一种情况下使用它,如果之前没有找到的话。
我尝试使用 RewriteCond,但我无法完成这项工作。
编辑:我也想重写异常,这可能吗?
【问题讨论】:
-
您想添加什么样的条件/例外?
-
我想用 RewriteRule 指定不同的 URL,然后,在最后一种情况下,如果没有找到,执行 catch-all regex 并调用 see.php。
标签: apache .htaccess rewrite catch-all