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

I need to redirect only to

Just homepage. Nothing else. ie should NOT redirect.

share|improve this question
up vote 1 down vote accepted

This should be what you want

RedirectMatch permanent ^/$
share|improve this answer
getting error on configtest – Harikrishnan Mar 25 '13 at 6:35
That's because this is an Apache configuration directive. – Michael Hampton Mar 25 '13 at 11:40
This ISN'T the correct answer. The question is about nginx, not apache. – Denys Vitali Feb 17 at 12:03
location = / {
    return 301;
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.