Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have a line in our HAProxy config that I uncomment when I want to put the site into 'maintenance mode'. It just redirects requests not for the static subdomain to a maintenance page.

redirect location unless { hdr(host) -i }

Of course, this is is a 30x type redirect, so a new http request, and the user sees the url change.

I'd prefer to simply rewrite the request to another url (so the original url does not change in the browser), but can't work out how to do this. I've tried experimenting with reqirep, but perhaps my regex-fu is not up to scratch.

Can anyone suggest a solution? Thanks

share|improve this question

The following rule should suffice:

reqirep ^.*


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.