Password Protect Home Page

Status
Not open for further replies.

grod77748

New Member
Messages
16
Reaction score
0
Points
0
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.
 

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
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.
 

grod77748

New Member
Messages
16
Reaction score
0
Points
0
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:

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
Post the current contents of .htaccess please.
 

grod77748

New Member
Messages
16
Reaction score
0
Points
0
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:

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
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)
 

grod77748

New Member
Messages
16
Reaction score
0
Points
0
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.
 
Status
Not open for further replies.
Top