匹配所有字母/数字组合,但匹配特定单词吗? [英] Match all letter/number combos but specific word?

查看:78
本文介绍了匹配所有字母/数字组合,但匹配特定单词吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经查看并发现了有关负面展望的事情,但是我仍然不确定该怎么做.我有一个RewriteRule ^([a-zA-Z0-9]+)/?$,它工作正常,但现在我希望它专门排除单词"help"(仅包括"help",而不是"helper","whelp"等),并可能排除少数其他单词.未来.抱歉,我知道这有很多类似的问题,但是我还无法弄清楚如何将其专门应用于此.

I've looked and found things about negative look ahead but I am still not sure what I should do for this. I have a RewriteRule ^([a-zA-Z0-9]+)/?$ which works fine except now I want it to exclude specifically the word "help" (only "help" and not "helper", "whelp", etc) and possibly a small number of other words in the future. and sorry, I know this has a lot of similar questions but I've not been able to figure out how to apply them to this specifically.

推荐答案

Apache mod-rewrite应该具有明确定义的顺序,以了解如何通过RewriteRules进行解析,以及在发生冲突时遵循的规则.

Apache mod-rewrite should have a well-defined order of how it parses through the RewriteRules and which rule it will follow if there are conflicts.

假设它将遵循第一个匹配规则,只需在通用规则之前定义特定规则即可.

Assuming it will follow the first matching rule, simply define the specific rules before the general one.

这篇关于匹配所有字母/数字组合,但匹配特定单词吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆