質問

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