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'm currently going back into an old domain and creating redirects for SEO purposes. I haven't done this much so I'm learning as I go along.

I'm trying to:

  • have some pages 301 directly to equivalent pages on the new site (done)
  • have one single page not redirect at all (need help)
  • have all other pages redirect to the new homepage (done)

So far I have:

RedirectMatch 301 contactinfo.html
RedirectMatch 301 (.).html 

How can I disallow the redirection of a single page?

share|improve this question
up vote 2 down vote accepted

The Redirect directives don't really have the flexibility to do this. Try using mod_rewrite:

RewriteEngine on
# Equivalent to your first RedirectMatch
RewriteRule ^contactinfo\.html$ [R=301,L]
# Avoids taking any action on this page.
RewriteRule ^filetonotredirect\.html$ - [L]
# Equivalent to your second RedirectMatch
RewriteRule ^.*\.html$ [R=301,L]
share|improve this answer
Perfect, thanks! – Wryan Aug 8 '11 at 16:40

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.