Is there a way to password protect HTML pages without using a server side language?

后端 未结 10 1600
情深已故
情深已故 2021-01-14 14:36

I have a series of interlinked web pages, and I want to restrict access to these pages by asking the user to provide a login and password. However, my hosting account curren

10条回答
  •  醉梦人生
    2021-01-14 15:01

    You can create a file .htaccess with something like this :

    AuthUserFile path/to/password.txt
    AuthGroupFile /dev/null
    AuthName "Acces Restreint"
    AuthType Basic
    
    require valid-user
    
    

    You then have to create the .htpasswd file.

提交回复
热议问题