Вопрос

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