Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

What is the URL provided to a RedirectMatch in a Directory context? Does Apache remove the part of the URL up to the current directory?

For context, I am trying to write a RedirectMatch in a directory context, and I want to know if I can anchor the front of the regex without having to include the server name and path, e.g.:

RedirectMatch ^/foo/([a-z-]+)$$1

This doesn't seem to work for me (neither does ^foo/...), but if I don't anchor the front, it does. I would like to be able to anchor the front of the regex...


share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.