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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.