403 Forbidden Error: How to Fix Access Denied
In this article
This guide walks you through the most common causes of a 403 Forbidden error and the exact steps to fix it, whether you're a website visitor or an administrator. The fixes range from simple browser actions to server-side configuration changes.
What You'll Need
- Access to the website's URL (for visitor fixes)
- If you're the site owner: FTP or file manager access, and/or control panel access (e.g., cPanel, Plesk)
- If you're the site owner: ability to edit files like
.htaccessor server config files
Step-by-Step
- Check the URL for typos. A mistyped address can point to a directory or file that doesn't exist or is restricted. Double-check the spelling and try the main domain (e.g.,
example.com) instead of a deep link. - Clear your browser cache and cookies. Stored cookies can sometimes cause a 403 if the server thinks you're not authorized. In Chrome: Settings → Privacy and security → Clear browsing data. Choose "All time" and clear both cache and cookies, then reload the page.
- Try a different browser or incognito/private mode. This rules out browser extensions or cached data as the cause. If it works in incognito, an extension (like an ad blocker or VPN) may be interfering—disable them one by one.
- Disable VPN or proxy services. Some websites block known VPN or proxy IP ranges. Temporarily turn off your VPN and try again.
- Check the file and directory permissions (if you're the site owner). On Linux servers, directories should typically be set to
755and files to644. If the index file (likeindex.htmlorindex.php) is missing or has permissions like000or600, the server will deny access. Use your FTP client or file manager to right-click the file/folder and set permissions. - Review the .htaccess file (Apache servers). A misconfigured
.htaccesscan block access. Open it via FTP or file manager and look for lines likedeny from allorRequire all denied. If you recently edited it, revert your changes. If unsure, rename it to.htaccess_backupand test—if the site loads, the file was the problem. - Check the index file exists. If you're seeing a 403 when visiting a directory (like
example.com/folder/), the server may be set to deny directory listings, and there's noindex.htmlorindex.phpin that folder. Upload an index file or enable directory listing (not recommended for security). - Restart your web server. After making configuration changes, restart Apache or Nginx. In cPanel, you can often do this via "Restart Services" or by contacting your host. On a VPS, run
sudo systemctl restart apache2(ornginx). - Contact your hosting provider. If you're not the server admin, or the above steps fail, your host may have blocked your IP or there's a server-level firewall rule. Provide them with the exact URL and any error logs you can access.
Common Mistakes
- Changing permissions to 777. This is a security risk and often still causes 403 if the server is configured to reject world-writable files. Stick to 755/644.
- Editing .htaccess without a backup. A typo can bring down your entire site. Always download a copy before editing.
- Forgetting to clear cache after server-side fixes. Your browser may still show the old 403 page. Hard refresh (Ctrl+F5) or clear cache again.
- Assuming it's a permissions issue when it's a firewall. If you're blocked by a WAF (Web Application Firewall) or IP ban, permission changes won't help.
Tips
- Check the server error logs. They often show the exact reason for the 403 (e.g., "client denied by server configuration"). In cPanel, look under "Errors" or "Raw Access Logs".
- If you use a CDN (like Cloudflare), purge the cache and check if a firewall rule is blocking your request.
- For WordPress sites, a plugin or security plugin (like Wordfence) can cause 403. Temporarily rename the plugin folder via FTP to disable all plugins and test.
- If you're a visitor, try the "Wayback Machine" (web.archive.org) to see if the page existed before—this can help you determine if it's a temporary issue.
Troubleshooting
If the above steps don't resolve the issue:
- Still getting 403 after clearing cache? Try a different device (phone vs. computer) or network (mobile data vs. Wi-Fi). This isolates whether it's your IP or device.
- You're the admin and .htaccess is fine? Check if the issue is with a specific file type. For example, if only .php files get 403, the PHP handler may be misconfigured. Reinstall or reconfigure PHP via your control panel.
- Error persists after restarting Apache? Check for syntax errors in your virtual host configuration. Run
apachectl configtest(on a VPS) or ask your host to do it. - If you're using Nginx: Check the
try_filesdirective and theallow/denyrules in your server block. A missingindexdirective can also cause 403. - If you're on shared hosting: Contact support—they may have security modules (like ModSecurity) that are blocking you. Ask them to check the ModSecurity audit log.
Frequently Asked Questions
What does 403 Forbidden mean exactly?
It means the server understood your request but is refusing to fulfill it. Unlike a 404 (not found), the resource exists but you're not allowed to access it.
Can a 403 be caused by a virus or malware?
Not directly, but malware on your computer could redirect you to blocked sites, or your IP could be flagged. Run a security scan if you suspect this.
Why does a 403 appear on my own website after I uploaded files?
Most likely file permissions are wrong. When uploading via FTP, set permissions to 644 for files and 755 for directories. Also ensure the index file is named correctly (e.g., index.html not Index.html).
How long does a 403 error last?
It varies. If it's a misconfiguration, it lasts until fixed. If it's an IP ban, it can last minutes to days. If it's a temporary server issue, it may resolve in a few minutes.
Is a 403 error the same as being blocked?
Yes, essentially. The server has decided you don't have permission. This could be due to IP blocking, missing authentication, or file permissions.
Can I fix a 403 error without FTP access?
If you're the site owner and have cPanel, you can use the File Manager to change permissions or edit .htaccess. If you have no control panel access, you'll need to contact your host.