Lock /install directory in .htpasswd but how?

Linda

Well-known member
Registered
Joined
Oct 22, 2021
Messages
110
Points
38

Reputation:

All I did.
The .htaccess file is created.
The .htpasswd is created.
Both files are in the root directory of the website.

Now the question for me is. How can I password protect the area: "mysite.tld/install"?

My entry in the .htaccess file

PHP:
AuthName "SecurityProtection

AuthType Basic

AuthUserFile path-to-your-website-root

<FilesMatch "/install.php">

require valid-user

</FilesMatch>

I can always access this area without a password. What am I doing wrong?

Example:
I want to set this area password:
https://enxf.net/install/index.php?upgrade/
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,520
Points
523

Reputation:

All I did.
The .htaccess file is created.
The .htpasswd is created.
Both files are in the root directory of the website.

Now the question for me is. How can I password protect the area: "mysite.tld/install"?

My entry in the .htaccess file

PHP:
AuthName "SecurityProtection

AuthType Basic

AuthUserFile path-to-your-website-root

<FilesMatch "/install.php">

require valid-user

</FilesMatch>

I can always access this area without a password. What am I doing wrong?

Example:
I want to set this area password:
https://enxf.net/install/index.php?upgrade/
Lindaplace the .htaccess file into the install folder and add the following:

if you only want to protect one page:
Apache config:
AuthName "SecurityProtection
AuthType Basic
AuthUserFile path-to-your-website-root
<Files protected_page.html>
    require valid-user
</Files>
if you want to protect the directory and everything in there and all below that folder
Apache config:
AuthName "SecurityProtection
AuthType Basic
AuthUserFile path-to-your-website-root
require valid-user
 

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
392
Points
53

Reputation:

place the .htaccess file into the install folder and add the following:

if you only want to protect one page:
Apache config:
AuthName "SecurityProtection
AuthType Basic
AuthUserFile path-to-your-website-root
<Files protected_page.html>
    require valid-user
</Files>
if you want to protect the directory and everything in there and all below that folder
Apache config:
AuthName "SecurityProtection
AuthType Basic
AuthUserFile path-to-your-website-root
require valid-user
BattleKinghoops wrong person

in your install folder make .htaccess than add this
HTML:
Order Deny,Allow
Deny from all
Allow from your ip address here
works
 
Top