+44 7575 472931[email protected]
HostAccentKnowledge BaseHosting, websites, SEO, and growth

403 Forbidden Error: How to Fix It (Step-by-Step 2026)

Got a 403 Forbidden Error? Fix it fast with our step-by-step guide — permissions, .htaccess, firewall and copy-paste commands that solve it in minutes.

Web HostingWebsite Security
Step-by-step guide to fixing a 403 Forbidden Error on a website, covering permissions, .htaccess, and firewall checks

Quick Answer: A 403 Forbidden Error means the server understood your request but refuses to serve the page. Nine times out of ten it's one of three things — wrong file permissions, a broken .htaccess rule, or a missing index file. Fix those in order and most 403 forbidden error cases clear in a few minutes. The exact sequence is below.

You loaded your site and got a wall of text: 403 Forbidden — You don't have permission to access this resource. Your stomach drops. The page was fine an hour ago.

Take a breath. A 403 forbidden error is almost never permanent, and it rarely means your data is gone. It means a gatekeeper on the server said "no" to this specific request. Your job is to find which gatekeeper — and change its mind.

This guide walks through every common cause of the 403 forbidden error, ranked by how often we actually see it, with the exact files, commands, and checks to fix each one. No theory dumps. Action first.

In the support tickets we handle at Hostaccent, the 403 forbidden error sits in the top five "my site is down" reports — and the cause is boringly predictable. So we'll start with the fix that clears most of them.

What a 403 Forbidden Error Actually Means

Every page load is a short conversation. Your browser asks the server for a file. The server checks two things: does this file exist, and is this visitor allowed to see it? A 403 status code is the server saying yes it exists, but no, you can't have it.

That's the difference from a 404. A 404 means "not found." A 403 means "found, but forbidden." The file is sitting right there. Something is blocking access to it.

You'll see it worded a few ways:

  • 403 Forbidden
  • Access denied — you don't have permission to access this website
  • Error 403 — You don't have permission to access / on this server
  • HTTP Error 403.x (on Windows/IIS hosts)

They all mean the same thing. An "access denied website" message and a plain 403 are the same problem wearing different clothes.

Pro Tip: Before you change anything, open the page in a private/incognito window. If it loads there, the block is tied to your browser cache or a login cookie — not the server. Clear your cache and you're done.

What Causes a 403 Forbidden Error? Ranked by Real Frequency

Here's the honest order from thousands of tickets — not a textbook list:

  1. Wrong file or folder permissions (~40% of cases)
  2. A broken or overly strict .htaccess rule (~30%)
  3. A missing index file or disabled directory listing (~12%)
  4. A firewall, WAF, or mod_security rule blocking the request (~10%)
  5. Wrong file ownership after a manual upload or extract (~5%)
  6. An IP block, hotlink protection, or country rule (~3%)

Work them in this order. Don't jump to the exotic causes before you've ruled out permissions — that's the mistake that turns a five-minute 403 forbidden fix into a two-hour one.

How to Fix a 403 Forbidden Error: Step-by-Step

Start at the top. Stop the moment your site loads.

Step 1 — Fix File and Folder Permissions

This is the number-one cause, so begin here. On a Linux server running Apache, the safe baseline is simple:

  • Folders: 755
  • Files: 644
  • wp-config.php (or any secrets file): 640 or 600

Two numbers cause most trouble. A folder set to 700 blocks the web server from reading it — an instant 403 forbidden error. A file or folder set to 777 is also a problem: many modern stacks (suEXEC, PHP-FPM) refuse to execute anything world-writable and throw a 403 on purpose, for security.

Fix it in your control panel: open File Manager, select public_html, and set folders to 755 and files to 644. Most panels apply this recursively.

Fix it over SSH (faster for a whole site):

bash
find /home/youruser/public_html -type d -exec chmod 755 {} \;
find /home/youruser/public_html -type f -exec chmod 644 {} \;

Then tighten your secrets file:

bash
chmod 600 /home/youruser/public_html/wp-config.php

Reload the page. If the 403 is gone, stop here — you're done.

Insider Insight: Never "fix" a 403 by setting everything to 777. It feels like it works because it removes the barrier, but it lets any process on the server rewrite your files. We've cleaned up more than one hacked site that started with a panicked chmod -R 777. 755 and 644 are the real answer.

Step 2 — Check Your .htaccess File

If permissions are correct and you still get the 403 forbidden error, the next suspect is .htaccess — a small config file in your site root that Apache reads on every request.

Look inside public_html/.htaccess for blocking lines like these:

bash
Require all denied
Deny from all
Order allow,deny
Deny from all

Any of those hard-blocks the whole site. They get added by a security plugin, a copied tutorial, or a migration gone sideways.

The safe test: rename the file to .htaccess_bak, then reload your site.

  • Site loads? The .htaccess was the culprit.
  • On WordPress, regenerate a clean one: go to Settings → Permalinks and click Save (no changes needed). WordPress writes a fresh, correct file. The official WordPress .htaccess reference shows exactly what the default block should contain.

If a rewrite rule caused it, add your rules back a few at a time until the 403 returns — that pinpoints the bad line.

Step 3 — Make Sure an Index File Exists

Open your site folder. Is there an index.php, index.html, or index.htm in it?

If not, Apache has no default page to serve. When directory listing is also turned off (the secure default), the server returns a 403 instead of showing your raw files. That's correct behavior — you just need an index file.

Two fixes:

  • Upload or restore your real index.php / index.html.
  • If you genuinely want a folder to list its contents, add Options +Indexes to that folder's .htaccess. For most sites you don't want this, so leave it off.

A fresh WordPress or app install showing a 403 usually means the files landed in the wrong folder. Confirm your document root points at the folder that actually holds index.php.

Step 4 — Rule Out a Firewall, WAF, or mod_security Block

Still stuck? The block may be happening before your files are even reached. Server-level security — mod_security rules, a CSF firewall, or a CDN's web application firewall — can return a 403 forbidden error on any request it decides looks malicious.

Two quick checks:

  • Read your error log. In cPanel it's under Metrics → Errors, or over SSH at /usr/local/apache/logs/error_log. A mod_security block names the rule ID that fired — hand that to your host's support and they can whitelist it.
  • Using Cloudflare or another CDN? Open the security events page and look for blocked requests around the time of your 403. If a Cloudflare WAF rule is matching, switch it from Block to Challenge, or add a path exception.

On our own stack at Hostaccent — Cloudflare in front of Nginx and Apache — most "mystery" 403s at this layer come from a security rule doing its job a little too eagerly. The fix is a precise whitelist, not switching protection off.

Step 5 — Fix File Ownership

Less common, but it bites after you upload as the wrong user or extract a backup over SSH as root. If files end up owned by root instead of your hosting account, Apache's suEXEC refuses to serve them, and you get a 403.

On a cPanel server, the owner should be your account username. Fix it (or ask support to):

bash
chown -R youruser:youruser /home/youruser/public_html

Then re-check Step 1 permissions, since extracting archives often resets them.

If the site loads for everyone except you — or only fails from one network — the 403 forbidden error is targeted, not global. A few culprits to check:

  • An IP deny rule. Look in .htaccess or your firewall for a Require not ip or Deny from line holding your own address. Security plugins sometimes ban you after failed logins.
  • Hotlink protection. If images throw a 403 but pages load, hotlink protection is rejecting requests whose referrer doesn't match your domain. Add the missing domains to the allow list in your control panel.
  • Country or ASN blocks. A firewall rule blocking a whole region returns an "access denied website" message to anyone in it. If you're testing from a VPN, switch it off and retry before assuming the worst.

This is the most overlooked 403 forbidden fix, because the site looks healthy from the office and broken from home. Always test from a second network — mobile data works — before you conclude the server itself is at fault.

How to Confirm the Fix and Stop It Coming Back

Don't just glance at the page. Confirm properly.

  • Hard-refresh with Ctrl+F5, and test in an incognito window to skip cache.
  • Check the real status code. Run curl -I https://yoursite.com from any terminal. A clean fix shows HTTP/2 200, not 403.
  • Test a few inner pages, not only the homepage — a permalink-related 403 forbidden error can hide on subpages while the homepage loads fine.

Once it's loading, lock in the win so the problem doesn't return:

Pro Tip: Add uptime monitoring that checks status codes, not just "is the site up." A monitor that flags a 403 the moment it appears turns a customer-reported outage into something you catch before anyone else does.

A recurring 403 forbidden error — one that returns every few days — is usually a security plugin or a cron job resetting permissions or rewriting .htaccess. Track when it happens and what ran just before, and the pattern gives the cause away. If your underlying performance is shaky too, WordPress Site Slow: Complete Diagnosis and Fix Guide (2026) and How to Fix High TTFB in WordPress: Step-by-Step Guide for 2026 pair well with this fix. Hosting that quietly throttles you or resets permissions can also surface as Core Web Vitals Failing? Your Hosting Might Be the Problem.

When to Stop Troubleshooting and Get Help

If you've worked through permissions, .htaccess, the index file, and your firewall, and the 403 forbidden error is still there, the cause is likely at the server or account level — and that's where good support earns its keep. Hosting built on NVMe SSD storage, a clean Cloudflare → Nginx → Apache stack, and humans who'll actually read your error log turns a fix like this into a five-minute reply instead of a forum guessing game. Hostaccent's Linux hosting starts at $1.99/yr, with UK-based support that handles exactly these tickets every day. If you're tired of fighting your server alone, it's worth a look — but try the steps above first, because most of the time you won't need us.

Frequently Asked Questions

Why am I getting a 403 forbidden error on my own website?

Most often it's file permissions or a .htaccess rule, not a hack. Set folders to 755 and files to 644, then rename .htaccess to test it. Those two steps clear the large majority of 403 forbidden error cases within a few minutes, no command line required.

How do I fix a 403 forbidden error in WordPress?

Deactivate all plugins, then reload. If the site returns, a plugin caused it — reactivate them one by one to find which. Also regenerate .htaccess via Settings → Permalinks → Save. This is the fastest 403 forbidden fix for most WordPress sites.

Does a 403 error mean my website was hacked?

Usually not. A 403 almost always points to permissions, .htaccess, or a firewall rule. A real hack is more likely to show defacement or strange redirects. Still, if you find unfamiliar rules inside .htaccess, scan for malware to be safe.

What's the difference between a 403 and a 404 error?

A 404 means the page wasn't found at all. A 403 means it was found but access is denied — the "access denied website" message. So a 403 is a permission problem, while a 404 is a missing-file or wrong-URL problem. Different cause, different fix.

Can my hosting provider fix a 403 forbidden error for me?

Yes. Server-level causes like mod_security blocks, file ownership, or firewall rules are best handled by support, who can read the raw error log. On a managed host like Hostaccent, this is a routine ticket, often resolved in a single reply.

Why does my 403 error keep coming back?

A recurring 403 forbidden error is usually a security plugin or a scheduled job resetting permissions or rewriting .htaccess. Note the timing, check what runs on that schedule, and disable or reconfigure it. Stable hosting plus working backups stops the cycle for good.

Reviewed by

Sarah Mitchell · Hosting Analyst & Reviewer

Last updated

Jun 15, 2026

S
Sarah MitchellHosting Analyst & Reviewer

Sarah benchmarks hosting providers on uptime, speed, and support quality, then writes detailed buyer guides to help businesses make confident infrastructure decisions.

Discussion

Have a question or tip about this topic? Share it below — your comment will appear after review.

Your email stays private and is only used for moderation.

Why am I getting a 403 forbidden error on my own website?

Most often it's file permissions or a .htaccess rule, not a hack. Set folders to 755 and files to 644, then rename .htaccess to test it. Those two steps clear the large majority of 403 forbidden error cases within a few minutes, no command line required.

How do I fix a 403 forbidden error in WordPress?

Deactivate all plugins, then reload. If the site returns, a plugin caused it — reactivate them one by one to find which. Also regenerate .htaccess via Settings → Permalinks → Save. This is the fastest 403 forbidden fix for most WordPress sites.

Does a 403 error mean my website was hacked?

Usually not. A 403 almost always points to permissions, .htaccess, or a firewall rule. A real hack is more likely to show defacement or strange redirects. Still, if you find unfamiliar rules inside .htaccess, scan for malware to be safe.

What's the difference between a 403 and a 404 error?

A 404 means the page wasn't found at all. A 403 means it was found but access is denied — the "access denied website" message. So a 403 is a permission problem, while a 404 is a missing-file or wrong-URL problem. Different cause, different fix.

Can my hosting provider fix a 403 forbidden error for me?

Yes. Server-level causes like modsecurity blocks, file ownership, or firewall rules are best handled by support, who can read the raw error log. On a managed host like Hostaccent, this is a routine ticket, often resolved in a single reply.

Why does my 403 error keep coming back?

A recurring 403 forbidden error is usually a security plugin or a scheduled job resetting permissions or rewriting .htaccess. Note the timing, check what runs on that schedule, and disable or reconfigure it. Stable hosting plus working backups stops the cycle for good.

Write for the Community

Have a tutorial, tip, or insight to share? Get published on the HostAccent Blog with your name, bio, and website link.

Become a Contributor

Need a faster setup for this workflow?