Protecting Site Files

Good evening, I would like to know if with a free infinity free account, it is possible to protect the site files, that is to say that when we go to the sources the users cannot see the files and their content, to avoid copies or to hide certain passwords.
So I would like to know if this is possible and if so how please.

THANKS

Can you provide more information on your situation? Exactly what content are you trying to hide? Placing sensitive information inside of PHP variables (And then never outputting them to the browser) is fine. If you want to secure entire directories with a password, you can use the “Protect Directories” feature in the control panel.

7 Likes

In fact, I would like that when we right click and then inspect or by pressing f12 directly, that the folders displayed as in the image are hidden or removed or at least that the code for each file is not there , because there are some sensitive information inside.

image

That is impossible.

Everything sent to the browser can be viewed by the user. If you don’t want the user to see it, don’t send it to the browser.

7 Likes

Then that’s the issue. Javascript, CSS and image files are rendered in the browser of visitors so they need to be downloadable to work. They should not contain any sensitive data. Any sensitive data, like credentials, should only be used in PHP code, which is executed on the server.

Either the files can be accessed or they cannot. If you remove the files, or block access to them, they are inaccessible and the data is safe, but then you won’t be able to use them on your website. If you want to be able to actually use the files, then they need to be downloadable, and any data in them is exposed.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.