I have the following URL which displays a normal static website: www.example.com. This site is hoted on Amazon.

I want to make all urls starting with www.example.com/redirect 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?


Have a look at the Redirect and RedirectMatch directives.

  • 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
  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.