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

Ok, so I'm in need a simple redirect:

Redirect 301 /

Similar to that, except I want it to catch anything, such as:

and send the user to:

Should be easy right? Finding out how to do this is not so easy. Using the above rule we're still getting 404's for things that aren't there rather than the Redirect rule just getting everything.

share|improve this question
Ever thought of mod_rewrite? – mailq Dec 1 '11 at 1:05
possible duplicate of Htaccess Redirect – mailq Dec 1 '11 at 1:06
Skip the .htaccess and put it directly into your server configuration. You may already have rewrite enabled or something. Remove that from your configuration. – Zoredache Dec 1 '11 at 1:07
up vote 5 down vote accepted

Alternatively, you can use the RedirectMatch directive instead of using mod_rewrite:

RedirectMatch 301 ^

Note the ^ can be interchanged with .*, both regular expressions with match everything.

share|improve this answer

This should work:-

RewriteRule (.*) [R=301,L]

The (.*) will match everything, and redirect to just

Edit: This was for Apache, I've retagged the question as being for Zeus.

share|improve this answer
Turns out it was Zeus Webserver so that didn't work (or rewriteengine doesn't exist/work on zeus..who knows.) :/ Nevermind. – John Hunt Dec 1 '11 at 1:17

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.