Forum Moderators: phranque

Message Too Old, No Replies

directory protection from some IP

required password when some login from specific IP

         

hamidejaz

10:16 am on Jul 12, 2010 (gmt 0)

10+ Year Member




i want to disable my website for Pakistani territory, right now i am using code filematch to disable user to access my website.

<FilesMatch "\.(php|jpg|gif)$">
order allow,deny
deny from 27.54.120.0/22
deny from 27.96.88.0/22
deny from 27.255.0.0/18
deny from 58.27.128.0/17
allow from all
</FilesMatch>

like this, but now i want that, when 58.27.128.2.34 user access my website, user and password authentication box popup for user id and password..

i am from Pakistan, i want that when anyone from Pakistan, access my website, the authentication box will appear for user id and password, but when anyone from any other country access my website, the website appear directly without any password or any other box..

jdMorgan

1:23 am on Jul 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Apache mod_auth and the Apache core directive "Satisfy any." Also, use "Order Deny,Allow" for this to work properly. This is not a simple change, so spend several hours with the documentation to avoid days of frustration...

Jim