Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 want the user to access, then I need authentication and based on the user I will then send them to a subdirectory. So the scenario is, if user TOM goes to .../internal/ I want him having to log in and if the login is successful he is redirected to .../internal/tom/. Within that folder is a simple php script. If the user MIKE logs in I want him to redirect to .../internal/mike/

share|improve this question

A rewriterule could be used to accomplish this.

Something like

RewriteCond  %{REMOTE_USER}  ^TOM
RewriteRule  ^/internal$                 /internal/tom  [L]

or more generally

RewriteCond  %{REMOTE_USER}  ^([A-Za-z]+)
RewriteRule  ^/internal$             /internal/$1 [L]
share|improve this answer

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.