ReWrite based on MySql query?.. hmm
Hi i'm new here, but great forum!
Hi I'll try to explain my question as good as possible.
OS=freeBSD
We're using the basic auth with a htpasswd file for our secure area. We have all our users in the MySql db which generates the .htpasswd file.
We're trying to use Mod Rewrite to redirect some of the users to another page like this:
RewriteCond /home/domain.com/securearea/expired_access/%{REMOTE_USER} -f
RewriteRule /* /home/domain.com/readthis.php?u=%{REMOTE_USER} [L,R]
this works fine, but the user is shown some sensitive info on the readthis.php page, so we need to make it more secure. We would like to have a script query our DB and get the password for the REMOTE_USER..so we can redirect them to:
/home/domain.com/readthis.php?u=%{REMOTE_USER}&password=%{PASSWORD_FROM_MYSQL_DB_QUERY}
and then generate the readthis.php page based on this user:pass combo match.
I was thinking about having a .pl script before the RewriteRule that would query the DB based on the %{REMOTE_USER} value.
I need to say that I have no clue about Mod ReWrite, i'm just trying to think of a way to pull this off since we can't let people inside the protected area before re-directing them, and we need the .htpasswd check to make sure we're showing the right info to the user.
I hope this possible?
- Nick
