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 want the user to access http://www.xyz/internal/, 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

1 Answer 1

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

 
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.