Guest LightKeeper Posted March 2, 2004 Posted March 2, 2004 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? Quote
TCH-Bruce Posted March 2, 2004 Posted March 2, 2004 (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 March 2, 2004 by TCH-Bruce Quote
HCSuperStores Posted March 2, 2004 Posted March 2, 2004 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 Quote
TCH-Bruce Posted March 2, 2004 Posted March 2, 2004 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. Quote
TCH-Bruce Posted March 2, 2004 Posted March 2, 2004 One more idea. If you did a redirect in the main folder to a sub folder and placed all web content in there, you could web protect it for sure. Quote
Guest LightKeeper Posted March 2, 2004 Posted March 2, 2004 I really wanted to keep my site in the main directory. Any other ideas? Quote
TCH-Bruce Posted March 2, 2004 Posted March 2, 2004 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 Quote
btrfld Posted March 2, 2004 Posted March 2, 2004 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. Quote
MikeJ Posted March 2, 2004 Posted March 2, 2004 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. Quote
Guest LightKeeper Posted March 2, 2004 Posted March 2, 2004 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 Quote
jacobw Posted March 3, 2004 Posted March 3, 2004 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.