S
S
sandul232021-05-03 15:53:08
htaccess
sandul23, 2021-05-03 15:53:08

How to allow a script to access a protected folder?

Hello everyone. I post all my projects on sprinthost hosting, maybe someone knows.
I ran into a problem. There is such a function in the control panel, protect the folder.
When using this function, gaining access to the selected folder outside the control panel becomes possible only when entering the password and login specified during protection.
The thing is this: when writing the site, I put all the scripts in one folder and protected it so that the user could not read, see, copy the code, in general, so that the user would not have any access to the code.
This is where the fun begins. During testing, I noticed that the program that "calls" the script cannot access it and requires the user to provide data to obtain this very access.
Question: How to allow the program access to scripts that are in a protected folder?
Here is what is in .htaccess:

### begin Sprinthost-secure 03.05.2021 13:10
AuthUserFile /home/user/domains/MyDomain/public_html/scripts/.htpasswd
AuthName "Authentication"
AuthType Basic
Require valid-user
<Files .ht*>
deny from all
</Files>
### Sprinthost-secure end

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2021-05-03
@AUser0

Obviously, in the program for HTTP AUTH , you need to specify the username and password from .htpasswd (the password is not in its pure form).
The easiest way to use HTTP AUTH: Access via URL http:// user : password @site.com/uri/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question