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

I have the following 2 files on my linux system:

/var/www/index.html = www.mywebsite.com

/var/www/foo/bar/index.html = www.mywebsite.com/foo/bar/index.html

I'm trying to figure out how I can set it up in Apache, so that when a user goes to "www.mywebsite.com/somedirectory" they are directed to the "/var/www/foo/bar/index.html" file.


/var/www/index.html = www.mywebsite.com

/var/www/food/bar/index.html = www.mywebsite.com/somedirectory

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You should clarify your specific needs and current configuration, but the simple way to do this is via mod_alias:

Alias /somedirectory /var/www/foo/bar

If that doesn't work or you need different behavior or more sophisticated logic, then let us know.

share|improve this answer
That works great. Thanks! –  flip66 Oct 17 '12 at 18:56

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.