Jump to content

htpasswd based on referer


anups

Recommended Posts

I have htaccess file from which I am calling htpasswd.

Currently its ask for authentication from everyone.

 

I want it IP based or Domain based so that a user requesting from specific IP may not have to go through http authentication.

 

Some domain calling the web pages in background like paypal OR  google checkout can access the page without http authentication.

 

Is it possible ?

 

content of htaccess file is given below.

 

AuthUserFile /var/www/web/.htpasswd

AuthName "Authorization Required"

AuthType Basic

<Limit GET POST>

  require user username

</Limit>

 

Link to comment
https://forums.phpfreaks.com/topic/220540-htpasswd-based-on-referer/
Share on other sites

if i understand what you are trying to do correct, php has several function shat can get the ip address like

$_SERVER['REMOTE_ADDR'];

.. and you can just bypass the login credentials and start your session for the user with their ip address as the credentials... hope this helps

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.