Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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've been trying to find specific information on the problem, but it all seems rather confusing or irrelevant.

I have an Apache install with several subfolders with different websites. I need requests for foo.com to redirect to .../htdocs/foo.

I'm trying to avoid the web address appearing in the browser as foo.com/foo, instead appearing as foo.com.

Is this possible?

share|improve this question
If I can give you a suggestion, unless you want to learn, you can get this done in 1 minute with a cPanel shared hosting by clicking a button called "add Addon domain". It will cost you not more than 50 bucks per year. It's worth the time you would waste setting up your own Apache config and it will for sure run in a more scure environment. – Marco Demaio Feb 26 '11 at 18:02
up vote 0 down vote accepted

This is done in the httpd.conf file not with .htaccess, here are some examples: http://httpd.apache.org/docs/2.2/vhosts/examples.html

share|improve this answer

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.