Forum Moderators: phranque

Message Too Old, No Replies

Redirect based on user for .htaccess

         

qsir1

6:53 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



I need to be able to redirect based on the user that logs in. I know that I can do it through php or perl but I NEED to do it through .htaccess. here's what I have now- it doesn't do any redirection. Any help would be greatly appreciated :)

RewriteEngine On
AuthType Basic
AuthUserFile /work/protect/.htpasswd
AuthName "PROTECTED"
require valid-user
satisfy any
# If it's user 'x', do this
#Redirect /work/protect/ [google.com...]
#if it user 'y', do this
#Redirect /work/protect/ [yahoo.com...]

<Limit GET>
order deny,allow
deny from all
</Limit>

jdMorgan

7:03 pm on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



qsir1,

Welcome to WebmasterWorld!

See Apache mod_rewrite [httpd.apache.org], and specifically the RewriteCond directive.


RewriteCond %{REMOTE_USER} ^user_Y$

ahead of a RewriteRule for redirection will probably do what you want.

Jim

qsir1

7:11 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



thanks. I'll try this ASAP