4

I have a site which have .htaccess password protected. Now I want to allow for some URL of the site.

https://www.exampale.com is password protected. But I don't want any password popup show for https://www.exampale.com/test/page/{variable}

Can this possible in .htaccess file ?

Need reverse of Password protect a specific URL

1 Answers1

2

You can use it in conjunction with mod_setenv directive as:

# set variable NO_PASS if URI starts with /test/page/
SetEnvIfNoCase Request_URI "^/test/page/" NO_PASS

# Allow NO_PASS but ask for password otherwise
AuthType Basic
AuthName "My Protected Area"
AuthUserFile /Full/Path/To/passwords
Require valid-user
Satisfy    any
Order      deny,allow
Deny from  all
Allow from env=NO_PASS
anubhava
  • 761,203
  • 64
  • 569
  • 643