Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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
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
add comment

Your Answer

 
discard

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.