views:

16

answers:

2

I have a site that is password-protected using a .htaccess and .htpasswd file. I'd like for users to bypass the login prompt ONLY if they come from a certain domain. Can this be done by embedding the .htaccess credentials as parameters in the link somehow?

Edit: I do manage the domain I'd like to whitelist, so how can I pass GET parameters in the link that the .htaccess file will process?

Thanks for the insight, Jen

+1  A: 

You should rethink this as it is trivial to spoof the referring domain (or any information from the client).

You users can easily select to save their username / password if they wish to.

jasonbar
+1  A: 

That would be highly insecure, the http referrer can be easily manipulated and your login bypassed.

If you own the other sites you can add some http header or GET var. If you don't, start thinking another solution for what you want to do.

nandu