Website Login

admin

Administrator
Staff member
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?<!--content-->
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.<br /><br />If this isn't the answer you were looking for, please provide more info and we'll try to help.<!--content-->
Hi there TCH-Bruce!<br /><br />Nice to SEE you! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><br /><br />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.<br /><br />However, we've both found that you can't do that to the root directory for some reason.<br /><br />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.<br /><br />Thanks!<br /><br />Bill<!--content-->
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.<br /><br />Not sure if it will work or not, maybe one of the TCH techs knows.<!--content-->
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.<!--content-->
I really wanted to keep my site in the main directory. Any other ideas?<!--content-->
Only other thing I can think of would be some kind of javascript of php scripting upon entry into the site.<br /><br />You may find something at <!--coloro:blue--><span style="color:blue"><!--/coloro-->www.hotscripts.com<!--colorc--></span><!--/colorc--><!--content-->
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.<!--content-->
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.<br /><br />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...<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->AuthType Basic<br />AuthName "Members Only"<br />AuthUserFile "/home/account/.htpasswds/secure/passwd"<br />require valid-user<!--c2--></div><!--ec2--><br /><br />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.<br /><br />I'm not sure why cPanel won't let you web protect the main directory directly.<!--content-->
<!--QuoteBegin-TCH-MikeJ+Mar 2 2004, 12:24 PM--><div class='quotetop'>QUOTE(TCH-MikeJ @ Mar 2 2004, 12:24 PM)</div><div class='quotemain'><!--QuoteEBegin-->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.<br /><br />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...<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->AuthType Basic<br />AuthName "Members Only"<br />AuthUserFile "/home/account/.htpasswds/secure/passwd"<br />require valid-user<!--c2--></div><!--ec2--><br /><br />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.<br /><br />I'm not sure why cPanel won't let you web protect the main directory directly.<!--QuoteEnd--></div><!--QuoteEEnd--><br /> That worked.... Thanks TCH-MikeJ<!--content-->
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.<br /><br />Thanks.<!--content-->
 
Top