Website Security on Shared Hosting: Practical Guides

On shared hosting you do not control the server, so security comes down to what you can do inside your own account: .htaccess rules, correct HTTPS and headers, strong password hashing, spam-proof forms, email authentication so your domain cannot be spoofed, and backups you have actually restored once. These guides cover exactly those controls, each with the configuration you can paste and a way to verify it worked.

They are written for site owners and developers who maintain business websites and small SaaS apps, with the same approach used on HeadsNTail itself: block what should never be public, authenticate what you send, and keep the fix simple enough to maintain.

Start here

  1. cPanel Emails Going to Spam? Fix SPF, DKIM & DMARC — Fix cPanel emails going to spam in Gmail and Outlook. Check SPF, DKIM, DMARC, reverse DNS, shared IP reputation, and Laravel SMTP settings.
  2. Mitigate BREACH Without Saying Goodbye to Compression — How BREACH abuses gzip and Brotli on HTTPS, and how to protect Laravel apps with token masking, SameSite and selective compression, not gzip off.
  3. How to Solve Google v3 reCAPTCHA Timeout in PHP Forms — reCAPTCHA v3 tokens expire after two minutes. Here's how to request them at submit time in PHP, handle AJAX forms, and debug failed checks.

Free tools for this topic

All guides in this topic (7)

FAQ

Is shared hosting safe for a business website?

Yes, if the account itself is hardened: HTTPS forced, sensitive files blocked in .htaccess, strong hashing for stored passwords, forms protected against spam and regular off-site backups. The host secures the server; you secure the site.

What should .htaccess block on a PHP site?

Access to .env, .git, composer files, logs, backups and SQL dumps, directory listing, and HTTP (redirect to HTTPS). The .htaccess generator produces these rules for cPanel.

Does Cloudflare replace these steps?

No. Cloudflare adds a firewall and DDoS protection in front of the site, but .htaccess, hashing, email authentication and backups still have to be done on the account.

All topics → · All free tools → · Latest articles →