开发者

Mod_rewrite rule if no other rules match

开发者 https://www.devze.com 2023-01-27 09:45 出处:网络
Is there a way 开发者_C百科to do a sort of \"catch all\" rule that will only be matched if no other rules have been matched in my .htaccess file?Put this rule as last rule to catch any request that co

Is there a way 开发者_C百科to do a sort of "catch all" rule that will only be matched if no other rules have been matched in my .htaccess file?


Put this rule as last rule to catch any request that could not be mapped onto an existing file:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ catch-all.foo


if you put your rule at the bottom, and have your other rules with a [L], it'll be considered the catch-all.

0

精彩评论

暂无评论...
验证码 换一张
取 消