Guides › HTML / PHP sites › Security & hacks

Exposed Files on Your Website: .git, .env, Backup Zips and Test Pages

Leftover files can leak passwords and source code. Search for them and remove or block them.

Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Security and hacking

Look for

What to do

  1. Open the addresses in a browser to confirm what is public.
  2. Delete files you do not need. Move needed backups out of the web root.
  3. Block sensitive patterns with server rules.
  4. If a secret was exposed, change it: database password, keys, salts.
  5. Disable directory listing. See WordPress Site Shows a Directory Listing or Index Of Page.

Check the logs for downloads of these files. See finding error logs.

Related guides

Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.

Last updated 2026-11-21.