Why Your Website Is Returning 403 Forbidden Errors and How to Fix It
Summary
This guide helps you troubleshoot and resolve: Why Your Website Is Returning 403 Forbidden Errors and How to Fix It. Follow the steps below to fix the issue.
Common Causes
A 403 Forbidden error means your website's server received the request from a visitor's browser but refused to allow access to the requested page or resource. Unlike a 404 Not Found error, the file or page exists, but permissions or security rules are blocking it. For small business owners, this can prevent customers from viewing your homepage, completing checkout flows, or accessing your administrative dashboard.
Quick Fix Steps
- Refresh the page to confirm the error is persistent and not a temporary glitch.
- Try accessing your website from a different device or mobile network to rule out a local IP block.
- Clear your browser cache and cookies, then attempt to load the site again.
- Check if the error affects your entire website or only specific pages, folders, or file types.
- Log in to your hosting control panel and review recent changes to file permissions, security plugins, or
.htaccessrules.
Detailed Instructions
Check File and Folder Permissions
Incorrect permissions are one of the most common causes of 403 errors. Web servers require specific read and execute permissions to serve files to visitors.
- Connect to your hosting account using an FTP client or the File Manager in your hosting control panel.
- Navigate to your website's root directory (commonly
public_html,httpdocs, orwww). - Right-click on folders and select File Permissions or Change Permissions.
- Set folders to
755and files to644. Avoid setting folders to777, as this is a security risk and many servers will reject it. - Apply the changes to folders only, then repeat for files if necessary.
- Refresh your website to see if the error is resolved.
If you are unsure which user owns your website files, contact your hosting provider before changing ownership settings. Incorrect ownership can prevent the web server from reading your files even when permissions appear correct.
Review Your .htaccess File
The .htaccess file controls access rules on Apache servers. A misconfigured rule can block all visitors or specific IP addresses.
- Open File Manager in your hosting control panel or connect via FTP.
- Locate the
.htaccessfile in your website root directory. If you cannot see it, enable the option to show hidden files. - Download a copy of the file to your computer as a backup.
- Open the file in a plain text editor and look for lines containing
deny from,Require all denied, orRewriteRuledirectives that may be blocking access. - Temporarily rename the file to
.htaccess_oldand refresh your website. - If the site loads, the
.htaccessfile was causing the issue. Recreate a default.htaccessfile or contact your developer to review the rules.
Editing .htaccess incorrectly can make your entire website inaccessible. Always keep a backup copy before making changes.
Check Security Plugins and Firewall Rules
If you use a content management system such as WordPress, Joomla, or Drupal, security plugins can mistakenly block legitimate visitors or your own IP address.
- Log in to your CMS admin dashboard.
- Navigate to your security or firewall plugin settings.
- Review the blocked IP list, blacklist, or firewall logs for your own IP address or your visitors' IP ranges.
- Remove any incorrect blocks and save the changes.
- If you cannot access the dashboard, connect via FTP and temporarily rename the security plugin's folder in
/wp-content/plugins/(for WordPress) or the equivalent extensions directory for your CMS.
Check ModSecurity and WAF Rules
Managed hosting environments often use ModSecurity or a Web Application Firewall (WAF) to block malicious traffic. These rules can sometimes trigger false positives and return 403 errors for legitimate visitors.
- Log in to your hosting control panel.
- For cPanel, navigate to Security > ModSecurity or ModSecurity Configuration.
- For Plesk, navigate to Websites & Domains > Web Application Firewall.
- Review the rule logs or audit logs for entries matching your IP address or the time the 403 error occurred.
- If a specific rule is blocking legitimate traffic, note the rule ID and contact your hosting provider to have it adjusted or whitelisted.
Verify Index Files and Directory Listings
If a visitor requests a folder instead of a specific file, the server looks for a default index file. If none exists and directory browsing is disabled, a 403 error may appear.
- Ensure your website root contains a default file such as
index.html,index.php, ordefault.aspx. - Check that the file is spelled correctly and uses lowercase letters, as Linux servers are case-sensitive.
- Confirm the file has read permissions set to
644.
Scan for Malware or Compromised Files
If 403 errors appear suddenly after a suspected site breach, malware or compromised files may be causing the issue. Malicious scripts can alter permissions or create access rules that block visitors.
- Run a malware scan using your CMS security plugin or your hosting provider's security scanner.
- Review recently modified files in your website root and upload directories.
- Restore affected files from a clean backup if compromise is confirmed.
- Update your CMS, themes, and plugins to the latest versions after cleaning the infection.
Troubleshooting
Error Affects Only One Page or File
- Check the permissions on that specific file or folder.
- Confirm the file name matches exactly what is linked in your website code.
- Verify the file is uploaded to the correct directory.
Error Affects the Entire Website
- Review your
.htaccessfile for global deny rules. - Check whether your hosting account has been suspended due to billing or policy issues.
- Confirm your domain's DNS is pointing to the correct hosting server.
You Are Blocked from Your Own Site
- Visit a site such as
whatismyip.com.auto find your current public IP address. - Check your hosting control panel's IP Deny Manager or firewall settings for your IP address.
- Remove the block if found, or contact your hosting provider to whitelist your IP.
Intermittent 403 Errors or CDN/WAF Blocks
If the 403 error happens only occasionally, or if you use a content delivery network such as Cloudflare, the block may be occurring at the edge network rather than your hosting server.
- Log in to your CDN or WAF provider dashboard (for example, Cloudflare).
- Navigate to the Security > Events or Security Events log.
- Look for 403 responses matched to your IP address or visitor IP ranges.
- To isolate the issue, temporarily disable the proxy or set your DNS record to DNS Only in your CDN dashboard.
- Refresh your website. If the error disappears, the CDN or WAF security rules are causing the block.
- Adjust the security level, create an IP allowlist rule, or contact your CDN provider for further assistance.
If you require assistance from our support team, please Open a Ticket and our Brisbane team will help you investigate the issue.
Still Having Issues?
💻 Open a Ticket