Jump to content

Website Login


Recommended Posts

Guest LightKeeper
Posted

I have a pretty basic html website. I was wondering if anyone knew how to make a login for a website that is written in .html?

Posted (edited)

Not sure if this is the answer to your question but if you go into cpanel and select Web Protect and select your root folder you can then add users and passwords the will prompt a login box to appear before they can enter your site.

 

If this isn't the answer you were looking for, please provide more info and we'll try to help.

Edited by TCH-Bruce
Posted

Hi there TCH-Bruce!

 

Nice to SEE you! ;)

 

I've been talking with LightKeeper off line and I think I'm suggesting the same thing you are. That is: to password protect the directory that he wants protected.

 

However, we've both found that you can't do that to the root directory for some reason.

 

If your "Web Protect" is something else, speak up. I'm not sure of a solution to do what we are talking about at the root level, which is what he wants.

 

Thanks!

 

Bill

Posted

Hmm, well I can't change either of my domains to test it but when you go into Web Protect the root folder is already selected.

 

Not sure if it will work or not, maybe one of the TCH techs knows.

Guest LightKeeper
Posted

I really wanted to keep my site in the main directory. Any other ideas?

Posted

Only other thing I can think of would be some kind of javascript of php scripting upon entry into the site.

 

You may find something at www.hotscripts.com

Posted

You can do it pretty simply in PHP. Don't know if you want to get involved in programming like that, but it's an option.

Posted

The easiest way (for some reason cPanel doesn't want to do it) is to just create a dummy directory (call it "secure" or something), and use web protect to create your users and enable web protection on that directory.

 

Then, copy the lines that look like the following out of the .htaccess file and put them in your .htaccess file of your public_html directory...

 

>AuthType Basic
AuthName "Members Only"
AuthUserFile "/home/account/.htpasswds/secure/passwd"
require valid-user

 

Then keep your "secure" directory around, because you can go back into web protect and manage the users by selecting the secure directory since the parent directory is using the same "passwd" file.

 

I'm not sure why cPanel won't let you web protect the main directory directly.

Guest LightKeeper
Posted
The easiest way (for some reason cPanel doesn't want to do it) is to just create a dummy directory (call it "secure" or something), and use web protect to create your users and enable web protection on that directory.

 

Then, copy the lines that look like the following out of the .htaccess file and put them in your .htaccess file of your public_html directory...

 

>AuthType Basic
AuthName "Members Only"
AuthUserFile "/home/account/.htpasswds/secure/passwd"
require valid-user

 

Then keep your "secure" directory around, because you can go back into web protect and manage the users by selecting the secure directory since the parent directory is using the same "passwd" file.

 

I'm not sure why cPanel won't let you web protect the main directory directly.

That worked.... Thanks TCH-MikeJ

Posted

What an awesome solution. I've never had any reason to password protect, but this is good info. to have in case I do need to password protect the root folder.

 

Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...