Page rule validation should check other page rules

Use case: Redirecting all pages to a maintenance page with a 302 redirect.

I created a page rule for the target (maintenance page) URL with some caching settings, to avoid looping, saved it as “Last”.

Then I created the Forwarding URL page rule with source

example.com/*

and target

example.com/maintenance-page/

And also tried to save it as “Last”, in which case this would be the real last position, and so it would not apply to the maintenance page itself, due to the previous page rule above.

I got the following error message:

Page Rule validation failed: See messages for details. (Code: 1004)

And the message it refers to was:

Forwarding URL matches the target and would cause a redirect loop

I believe this could be improved by making sure the validation process check if there is a page rule for the target URL and that it is properly positioned (i.e., before the /* page rule).

Also, a mechanism could be developed to prevent toggling on the redirects if afterwards the user moves the positions of the rules in a way that would cause the looping.