Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 have some folders:

~/dev/php/public and ~/dev/php/private~

in apache, how can i make domain.com/php/public go to ~/dev/php/public? and the same with private? they are on the same domain so i dont need to create a virtual host or anything..

share|improve this question

Depending on your setup there a re a few ways of doing it -

  1. Modify your Apache Document Root or
  2. Use mod_rewrite to rewrite the location or
  3. Create a symlink in your directory tree to your /home/username/dev/php
  4. Use mod_alias (alias)

I believe mod_alias is the most likely the best solution - so something like the following might do you:

Alias /php/public /home/USERNAME/dev/php/public
Alias /php/private /home/USERNAME/dev/php/private

In your apache config. (This assumes that the home directory of the owner is "/home/USERNAME")

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .