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 have the following URL which displays a normal static website: This site is hoted on Amazon.

I want to make all urls starting with to redirect to another hosting account that I have. Note that I also want the host to be at the above domain (i.e., it is not a re-direct to another url here).

If this account is located at 1.23.345.678. What do I need to change in the .htaccess file in order to do this redirect?

share|improve this question
up vote 1 down vote accepted

Have a look at the Redirect and RedirectMatch directives.

share|improve this answer
Thanks. So, if I understand correctly, Redirect /redirect 1.23.345.678. How would this actually look in the .htaccess file, with tags and all? – David542 Jan 30 '12 at 22:52
Almost exactly as you've just done it, except it needs to be a URL - so http://x.x.x.x/ - not just the IP. If it doesn't work right away, you might need to tweak AllowOverride in the Apache config. – James O'Gorman Jan 30 '12 at 22:53

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.