如果没有其他规则匹配,则 Mod_rewrite 规则
有没有办法执行一种“捕获所有”规则,只有在我的 .htaccess 文件中没有匹配其他规则时才会匹配该规则?
Is there a way to do a sort of "catch all" rule that will only be matched if no other rules have been matched in my .htaccess file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将此规则作为最后一条规则以捕获无法映射到现有文件的任何请求:
Put this rule as last rule to catch any request that could not be mapped onto an existing file:
如果您将规则放在底部,而其他规则带有 [L],则它将被视为包罗万象。
if you put your rule at the bottom, and have your other rules with a [L], it'll be considered the catch-all.