Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (20 loc) · 615 Bytes

secure-root-directory.md

File metadata and controls

25 lines (20 loc) · 615 Bytes

Secure Root Project Directory

This is very important to secure your project directory to prevent unwanted access

Code Sample

Create a htaccess to your root project, e.g: /var/www/html/project/.htaccess

# Disable server signature
ServerSignature Off

# Disable directory listing
IndexIgnore *

# Disable access to /vendor/*
RewriteRule ^(.*)/vendor/.*\.(php|rb|py)$ - [F,L,NC]
RewriteRule ^vendor/.*\.(php|rb|py)$ - [F,L,NC]

# Disable anything access to .htaccess, .env, etc
<FilesMatch "^\.">
  Order allow,deny
  Deny from all
</FilesMatch>

Table Of Contents