
The short answer: everything in the site folder can be requested by anyone who guesses the file name. Git folders, files with passwords (.env), copies like wp-config.php.bak and database dumps (.sql) get forgotten there. Bots look for those names every day. Check, delete and block.
What the site needs
| What | What to do |
| The .git folder | It holds all the code and the history, including old passwords someone wrote and then deleted. your-domain.com/.git/config must not open. |
| The .env file | The application’s passwords and keys: Keeping passwords out of your PHP code. |
| File copies | wp-config.php.bak, config.old, a .zip of the site, “backup” folders: the server hands them over as text or as a download. |
| Database dumps | An .sql file in the site folder is the whole database, one address away. |
| Logs and test tools | debug.log, error_log, phpinfo.php, installers: Debug mode. |
Getting started
|
|
|
|
|
| Deleting the file is not enough if someone already read it. If it was public, assume it was copied and change the passwords. Then check for strange access: After a hack. |
| To publish with Git without exposing the .git folder, see Git in cPanel. Security headers help, but do not replace this: Security headers. |
|
Found something exposed and do not know how to close it? Open a ticket with the address, without copying the file’s contents. Open a support ticket |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











