403 Forbidden: What It Means and How to Fix It

Key Takeaways
- ✓A 403 means the server understood the request and refuses to allow it.
- ✓Visitors: check the URL, try a private window, turn off the VPN, try another network.
- ✓Site owners: read the error log, then check permissions, index file, deny rules and firewall.
- ✓Use 755 for folders and 644 for files, never 777.
Table of Contents
- •403 Forbidden: What It Means and How to Fix It
- •403 Forbidden: What It Means and How to Fix It
- •What the Error Looks Like
- •If You Are a Visitor
- •What Causes a 403 Forbidden
- •If It Is Your Website
- •1. Read the error log first
- •2. Fix permissions and ownership
- •3. Check that an index file exists
- •4. Look for deny rules
- •5. Check the firewall, CDN and plugins
- •403 vs 401 vs 404
- •Does a 403 Hurt SEO?
- •Frequently Asked Questions
403 Forbidden: What It Means and How to Fix It
A 403 Forbidden error means the server understood your request and refuses to allow it. The page or file may well exist, but you are not permitted to see it. Logging in again usually does not help, which is the difference from a 401 error, where the server asks you to sign in.
403 Forbidden: What It Means and How to Fix It
Sometimes a 403 is intended: the owner has blocked a folder, a country or an IP address. Often it is a mistake in permissions or rules. This guide covers what a visitor can try and how a site owner finds the rule or permission behind it.
What the Error Looks Like
403 ForbiddenwithnginxorApacheunderneathHTTP Error 403 - ForbiddenYou don't have permission to access this resource(Apache)Access DeniedorError 1020: Access denied(Cloudflare firewall rule)403. That's an error.(Google services)
If You Are a Visitor
Check the address. A URL that ends in a folder name, such as
/images/, is often blocked on purpose. Go to the page you actually wanted.Reload, then try a private window. If it works there, clear cookies and cache for that site. An old login cookie can cause a 403.
Sign in. Some sites return 403 to people who are signed out or whose account lacks access.
Turn off your VPN or proxy. Many sites block VPN and datacentre IP addresses.
Try another network. If it loads on mobile data, your IP address is blocked. Contact the site's owner.
What Causes a 403 Forbidden
| Cause | What is happening |
|---|---|
| File or folder permissions | The web server's user can't read the file or enter one of its parent folders |
| No index file | The URL points at a folder with no index.html or index.php, and directory listing is off |
| A deny rule | A rule in .htaccess, the Nginx config or the app blocks the path, IP address or country |
| Firewall or security plugin | A web application firewall, Cloudflare rule or WordPress security plugin blocked the request |
| Hotlink protection | The server refuses images or files requested from another website |
| Wrong owner after an upload or migration | Files belong to root or another user instead of the web server's user |
If It Is Your Website
1. Read the error log first
The server's error log states why it refused the request. On Nginx that is /var/log/nginx/error.log; on Apache it is usually /var/log/apache2/error.log or /var/log/httpd/error_log. If nothing is logged there, the 403 came from something in front of the server (a CDN or firewall) or from the application itself.
2. Fix permissions and ownership
The usual safe values are 755 for folders and 644 for files, owned by the user your web server runs as (often www-data on Ubuntu and Debian):
sudo chown -R www-data:www-data /var/www/yoursite
sudo find /var/www/yoursite -type d -exec chmod 755 {} \;
sudo find /var/www/yoursite -type f -exec chmod 644 {} \;Never use 777 to make a 403 go away. It lets any user on the server change your files.
3. Check that an index file exists
If the site's root folder has no index file, the server returns 403 instead of listing the folder. Upload the site's files to the right folder, or correct the document root in the server config.
4. Look for deny rules
On Apache, rename .htaccess for a moment and reload the page. If the 403 goes away, a rule in that file caused it. Look for Deny from, Require and rewrite rules that end in [F]. On Nginx, search the config for deny and return 403. Our Nginx 403 Forbidden guide walks through six causes, including SELinux.
5. Check the firewall, CDN and plugins
If you use Cloudflare or another firewall, look at its security events for the blocked request and adjust the rule that matched. On WordPress, turn off security plugins one at a time; they can block your own IP address after failed logins.
403 vs 401 vs 404
| Code | Meaning |
|---|---|
| 401 Unauthorized | You need to sign in, or your credentials were wrong |
| 403 Forbidden | The server knows what you asked for and refuses to allow it |
| 404 Not Found | Nothing exists at that address (see 404 Not Found) |
Does a 403 Hurt SEO?
Yes, if it hits pages you want in search. Google can't read a page that returns 403, and pages that keep returning it are removed from the index. Use Search Console's URL Inspection to confirm Googlebot can fetch your important pages, and make sure no firewall rule blocks it.
Frequently Asked Questions
Why am I getting 403 Forbidden on one website only?
That site has blocked the request: your IP address, your country, your VPN or a page you are not allowed to see. Try another network; if it works, the block is on your IP address.
Can clearing cookies fix a 403 error?
Sometimes. An expired or corrupted login cookie can make a site refuse your requests. Clearing cookies for that site and signing in again fixes that case.
What file permissions fix a 403 error?
Folders normally need 755 and files 644, owned by the user the web server runs as. Each parent folder also has to allow the web server to enter it.
Is 403 Forbidden a virus or a hack?
No. It is a normal response from a web server that refuses a request. It does not mean your device or the website is infected.
Unsure Which Cloud Hosting Plan Fits Your Site?
Answer 4 quick diagnostic questions to estimate the server CPU, RAM and storage you need with transparent pricing.
Cloud Infrastructure Engineer.
Related Posts
DevOps & TutorialsDocker Port Mapping Explained: -p, EXPOSE and Compose ports
How Docker port mapping works: the -p syntax, EXPOSE vs publishing, Compose ports, service names on the network, and the UFW security detail most guides skip.
DevOps & TutorialsDocker Engine vs Docker Desktop: Which One Do You Need?
Docker Engine is the open-source runtime for Linux; Docker Desktop is a desktop app with a VM, GUI and its own licence. Which to use on servers and laptops.
DevOps & TutorialsERR_CONNECTION_REFUSED: What It Means and How to Fix It
ERR_CONNECTION_REFUSED means your browser reached the address and the connection was rejected. Fixes for visitors, for localhost and for server owners.