jeudi 3 septembre 2015

Block website for all user agents expect one and allow all user agents to specific URL

I want to block all user agents except one for entire website, and at the same time allow access all user agents to one specific URL. When any user want to reset password I need to unblock all user agents to URL like this:

http://ift.tt/1IMDpJO

login and key are variables.

I have this piece of code in my .htaccess file, but it doesn't work correctly. Right now it blocks all user agents except allowagent but I can't get access to reset url from other agents.

SetEnvIfNoCase User-Agent .*allowagent.* good_agent
SetEnvIf Request_URI "^/reset-password.*$" ResetUri

Order Deny,Allow
Deny from All
Allow from env=good_robot
Allow from env=ResetUri

So, my question is here, how to modify this .htaccess to block all user agents expect allowagent and unblock URI to reset password for all user agents?




Aucun commentaire:

Enregistrer un commentaire