Setup redirects with Modsec


The web servers I managed are all running Apache 2.4 with Modsec. Is it possible to write a rule that will serve up a different page if matched by Modsec? I want this to be independent of the domain.

For example, if or redirect to

Best Answer

Yes you can, use the redirect action.

For example:

SecRule REQUEST_URI "/login" "phase:1,id:52,status:302,redirect:

Though if doing a straight redirect like above you’d be better doing this in Apache.

Related Topic