Reputation: 4857
I want to set different htpasswd for different pages in my website. How can i do that?
Set different htpasswd for different pages in site... Like example.com/about and example.com/portfolio should have different passwords.
Upvotes: 1
Views: 868
Reputation: 4917
If each page has its own directory, then you can just create a .htaccess
page for each one.
However, if they're all on the root, then you might be able to achieve this using an if directive
So for example:
<if "%{HTTP_HOST} == 'example.com/about'">
....
</if>
Then place your authentication code inside the if directive
. You could do this for each directory you want to use a different password on.
Upvotes: 1