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 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.

So....

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

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

share|improve this question
add comment

1 Answer

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! –  user1024370 Oct 17 '12 at 18:56
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.