Closed Thread
Results 1 to 7 of 7

Thread: Password Protect Home Page

  1. #1
    grod77748 is offline x10Hosting Member grod77748 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    16

    Password Protect Home Page

    Probably a newbie question but:
    I have my public_html folder password protected.
    I created a sub domain but I do not want to password protect that.
    My index.html file is in the root of the public_html folder.
    Is there a way to just protect the index.html file?
    Keep in mind that I have folder in the root of public_html.
    Any help would be appreciated.
    thx.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Password Protect Home Page

    Code:
    <FilesMatch "index.html">
    AuthName "Member Only"
    AuthType Basic
    AuthUserFile /home/YOURusername/.htpasswds/public_html/passwds
    require valid-user
    </FilesMatch>
    Or something similar in your .htaccess file.

    Then make your index page in your subdomain index.php, index.htm etc.
    Nothing is always absolutely so.

  3. #3
    grod77748 is offline x10Hosting Member grod77748 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    16

    Re: Password Protect Home Page

    I will try that once ftp on starka starts working again. I do not see the .htaccess in the file manager through cpanel. I was only able to see it when using ftp.

    Is there a way to do that with cpanel and Password Protect Directories?

    ---------- Post added at 03:22 AM ---------- Previous post was at 02:42 AM ----------

    I was able to access the .htaccess file using legacy file manager.
    Is this something I have to insert? I don't see that in my file.
    <FilesMatch "index.html">

    Also,for this-do I replace member only with index.html?
    AuthName "Member Only"
    Last edited by grod77748; 11-19-2010 at 08:48 PM.

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Password Protect Home Page

    Post the current contents of .htaccess please.
    Nothing is always absolutely so.

  5. #5
    grod77748 is offline x10Hosting Member grod77748 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    16

    Re: Password Protect Home Page

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName "Home Page"
    AuthUserFile "/home/xxxxxx/.htpasswds/public_html/passwd"
    AuthType Basic
    require valid-user
    Last edited by grod77748; 11-19-2010 at 10:22 PM.

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Password Protect Home Page

    Code:
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    
    <FilesMatch "index.html">
    AuthName "Home Page"
    AuthUserFile "/home/XXXXXX/.htpasswds/public_html/passwd"
    AuthType Basic
    require valid-user
    </FilesMatch>
    is all you need. (you might want to edit out your cPanel username from your post above)
    Nothing is always absolutely so.

  7. #7
    grod77748 is offline x10Hosting Member grod77748 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    16

    Re: Password Protect Home Page

    OOPS!
    I tried that but when I go to the web page it never asks for a user name and password.
    I get a page stating 401 Authorization Required.

Closed Thread

Similar Threads

  1. Password Protect a Page - Details
    By jfrancis5144 in forum Free Hosting
    Replies: 0
    Last Post: 09-11-2010, 04:19 AM
  2. Replies: 2
    Last Post: 06-14-2010, 09:11 PM
  3. Password Protect a page
    By dontbeajew in forum Graphics & Webdesign
    Replies: 5
    Last Post: 02-12-2010, 08:14 PM
  4. Password Protect
    By fpecka in forum Programming Help
    Replies: 7
    Last Post: 10-27-2009, 03:48 AM
  5. how to password protect your folder
    By agaitu in forum Tutorials
    Replies: 6
    Last Post: 12-14-2007, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers