且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将Apache告诉与此相对的LocationMatch?

更新时间:2023-11-26 17:58:58

对于Apache 2.2(不确定以前的版本),您可以使用正负表达式来匹配正则表达式,以匹配除/assets像这样:

With Apache 2.2 (not sure about previous versions), you can use a regular expression with a negative lookahead to match all root location URL-path directories other than /assets like so:

<LocationMatch "^(?!/assets)/[^/]+">
    ...
</LocationMatch>

请注意,这不包括根URL路径/本身.

Note that this does not include the root URL-path / itself.