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.

3
  • Ever thought of mod_rewrite?
    – mailq
    Dec 1, 2011 at 1:05
  • possible duplicate of Htaccess Redirect
    – mailq
    Dec 1, 2011 at 1: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 1, 2011 at 1:07

2 Answers 2

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.

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.

1
  • 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, 2011 at 1:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .