Website Folder Security

I’ve a question regarding website folder security. Is there any way to protect my folder which i can not disclose with the viewers ? Also i need to know about the protection protocol for HTML website and CSS, JAVASCRIPT. Everyone can see the folders from “Inspect” in the browser. So if you have suggestion please let me know. Thank you


just create .htaccess file with this content (in folder you want)

# Disable Directory Listings in this Directory and Subdirectories
# This will hide the files from the public unless they know direct URLs
Options -Indexes

If you want it to be for all - put it in root of htdocs

If you want the folder to be visible only to the code that runs on the server (nothing public - no browser/web)
use this code in .htaccess

Require all denied

Didn’t work for me. I can still able to open the folders from the website. I think i need to encrypt my index.html code. but some my css not working when i used my encrypt code. :confused: Any idea ?

I’m not sure what you mean by encrypting the code. HTML code cannot really be encrypted, and still be usable as a web page for anyone. You can use Javascript to obfuscate it, but obfuscation is not encryption and only creates inconvenience for any hackers, rather than actual protection.

I checked your account and was unable to find any directory with any .htaccess protections. I see you’ve tried to protect your main directory with a password, but the main .htaccess page only contains the ErrorDocument rule now. If you want to password protect your entire website, please set it up again through the control panel (and make sure you don’t remove the .htaccess rules it creates again).

It must work.

What I doubt that happened to you (if you did everything correctly) is that your browser simply displayed the cached page.
Make sure you delete the cache (CTRL + F5) when checking

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