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.

Is this even possible?

Say I have a server, devbox.local, which has several HTTP auth users: alan, bill, carl. What I'm trying to do is tell Apache to use a different DocumentRoot depending on who is logged in at the time. So user alan might see a docroot from /var/www/html, bill might see /home/bill/public_html, and carl might see some other directory entirely.

I know some of you will jump straight to the "use mod_userdir for this" response, but that would create URLs in the form http://devbox.local/~bill/whatever -- which is not what we want. (Each user will be working on a separate copy of a web app that reeeeally doesn't like not being in the domain's root directory. Believe me, we've tried.)

I'm also trying to avoid using subdomains unless there's no other alternative, as I really don't want to have to hork around with our vhosts/DNS/hosts files if (when) we move things around later.

share|improve this question
add comment

1 Answer

mod_rewrite is probably what you're looking for.

Check the documentation on how to use the %{REMOTE_USER} variable to rewrite the URL.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.