Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

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.