I am trying to password protect a page on my site. I am using .htaccess and .htpasswd files. It isn’t working. What do I do? My site is flench.glitch.me.
From a quick look at the developer console, I see that you’re trying to use server-sided JS on the client. This naturally throws and error, which may be preventing password protection. My suggestion is to make an input prompt when the user opens your webpage.
Glitch projects do not include apache automatically, you will have to remix this project to get apache on a glitch project : https://glitch.com/edit/#!/lamp-poc
Apache is required to use things like htacccess
@Fleench is right, you would need a database (sqlLite is supported or a JSON file) a way to call the data (jQuery) and a way to stop people accessing the console.
See if this works!
I tried using that to access htaccess. It did not work.
glitch made this basic auth example for protecting sites: