Password Protecting a Site

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.

1 Like

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.
image

1 Like

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

2 Likes

This would work but using the web browsers developer mode they could look at the javascript file and see the pass code.

1 Like

@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!

1 Like

I tried using that to access htaccess. It did not work.

1 Like

got an idea- try javascript!

glitch made this basic auth example for protecting sites:

4 Likes

my school blocked everything even your website i bet if i see it’s going to look cool

what are the username and password

You set them in your .env file.

Username is “guest”, password you can set in the .env file

Yea what is it

@USERone
10chars