Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top