문제

I have a working RedirectRule to which I want to add an exception. Here is the current RedirectRule:

RedirectMatch (?i)/.+menu\.html$ http://www.foobar.com/foobar.html

I would like to exempt ext3270-Menu.html from this rule.

I found the following example at https://serverfault.com/questions/189666/make-exception-to-whole-site-redirectmatch-rule:

RedirectMatch permanent ^/?((?!(thisisfoo|thisisbar)).*) https://www.foobar.com/$1

I was hoping someone who is more adept than me at PCRE could respond with something similar that would meet my requirements.

Thanks

도움이 되었습니까?

해결책

As you said PCRE, use negative lookahead to see if there is no ext3270-Menu.html in your URI.

(?i)^/(?!.*ext3270-Menu\.html).+menu\.html$

Online Demo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top