3

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

Redirect 301 / http://www.new.com/

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

www.old.com/blah/blah/?xyz=123&aaaaabbbb=erewr3ttt#ewtjhirhjerh

and send the user to:

www.new.com

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.

Andy Smith
  • 1,798
  • 13
  • 15
John Hunt
  • 428
  • 2
  • 10
  • 20
  • Ever thought of `mod_rewrite`? – mailq Dec 01 '11 at 01:05
  • possible duplicate of [Htaccess Redirect](http://serverfault.com/questions/49361/htaccess-redirect) – mailq Dec 01 '11 at 01:06
  • 1
    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 01 '11 at 01:07

2 Answers2

5

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

RedirectMatch 301 ^ http://www.new.com/

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

Jon Lin
  • 1,343
  • 9
  • 21
1

This should work:-

RewriteRule (.*) http://www.new.com/ [R=301,L]

The (.*) will match everything, and redirect to just http://www.new.com/.

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

Andy Smith
  • 1,798
  • 13
  • 15
  • 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 01 '11 at 01:17