Don’t miss the New Year’s Sale deals!
search

How to fix the 403 Forbidden error (11 simple methods)

How to fix the 403 Forbidden error (11 simple methods)

A 403 Forbidden error is an HTTP status code that blocks access due to permission or configuration issues. This error indicates that the server understands the request but refuses to authorize it, typically because of restricted permissions.

Keep reading as we walk you through actionable solutions to fix the 403 Forbidden error, from simple troubleshooting steps to more advanced server-side configurations:

  • Clear browser cache and cookies.
  • Temporarily disable your VPN.
  • Scan for malware.
  • Disable conflicting WordPress plugins.
  • Turn off your CDN temporarily.
  • Restore or regenerate the .htaccess file.
  • Reset file and directory permissions.
  • Edit file ownership settings.
  • Upload an index page.
  • Verify your A record.
  • Update your nameservers.

Additionally, potential causes that can trigger this error include:

  • Misconfigured file and folder permission settings. Prevents users from accessing sensitive files or certain parts of a website, often leading to a 403 Forbidden error.
  • Corrupt .htaccess file. Misconfiguration or malware can break the .htaccess code.
  • Missing index page. The index.html or index.php file, which is the default homepage template, isn’t available in the website’s directory.
  • Incompatible WordPress plugin. A WordPress plugin might be conflicting with another plugin or could’ve been incorrectly configured.
  • Incorrect IP address. The domain name points to an inaccurate IP address, blocking access to your website.
  • Malware scan. Your website’s security measures can limit access to specific resources to prevent malicious attacks.
  • New webpage link. The webpage link was recently updated, causing it to differ from the cached version.
  • Empty website directory. The URL is trying to access your website’s directory instead of a file.

Download comprehensive HTTP status codes cheat sheet

1. Clear your browser cache and cookies

Browser cache stores outdated files, which can conflict with updated site permissions and trigger a 403 error. Cookies save login and preference data, and when they become corrupted or outdated, they may block access to some pages.

First, clear your browser cache and cookies to remove any conflicting or outdated data. This forces the browser to fetch fresh files from the server, which can resolve access issues – though you’ll need to log in again to most sites afterward.

Here’s how to do it in Google Chrome (similar steps apply to Firefox and Safari):

  1. Click the three-dot icon in the top-right corner and select Settings.
  2. Go to Privacy and securityDelete browsing data.
  3. In the time range menu, choose All time.
  4. Check Cookies and other site data and Cached images and files.
  5. Click Delete data to remove them.

After clearing cache and cookies, revisit the website and try logging in to see if the 403 Forbidden error is resolved.

2. Temporarily disable VPN

A virtual private network (VPN) routes your connection through remote servers. However, some websites block these servers for security or regional compliance, often resulting in a 403 error.

Temporarily disable your VPN and try accessing the website again. If this resolves the issue, switch to a different VPN server or contact your VPN provider for guidance.

If these simple checks don’t solve the problem, move on to the next steps, which involve checking your website’s security.

3. Scan for malware

Malware can insert harmful code into your website’s files. This can change permissions or configuration rules, leading to restricted access and a 403 Forbidden response.

Scan your website for malware to identify and remove any harmful code. On Hostinger web hosting plans, you can use the built-in Malware Scanner in hPanel without third-party tools:

  1. Go to your website’s dashboard, then select Security → Malware Scanner from the left sidebar.
  2. If no malware is found, you’ll see your hosting plan’s name and the time since the last scan.
  1. Otherwise, the tool will list the infected files and the actions taken to clean them.

For additional protection, use reputable WordPress malware scanner plugins like Wordfence or Solid Security. These tools detect threats in real time and block suspicious activity before it can cause further issues.

If the scan reveals infections, clean or replace the affected files, then recheck your site to confirm the 403 error is gone.

Hostinger web hosting banner

4. Disable WordPress plugins

Faulty or incompatible WordPress plugins may override permission settings. When this happens, affected pages can become inaccessible and return a 403 Forbidden error.

Disable your WordPress plugins to determine if one is causing the issue. You can do this from your WordPress dashboard or directly in hPanel if you’re a Hostinger customer:

  1. From your website’s dashboard, go to WordPress → Security.
  2. Scroll down to the Installed plugins section.
  3. Toggle each plugin off individually and check your site after each change.

If you prefer a manual method, you can disable all plugins at once via the file manager or an FTP client:

  1. Navigate to the wp-content folder in public_html.
  2. Rename the plugins folder to disabled-plugins. This will deactivate all plugins simultaneously.
  1. Check your website. If the error is gone, one of the plugins is the culprit.
  2. Rename the folder back to plugins to reactivate them.
  3. From your WordPress dashboard, deactivate plugins one by one to identify the problematic one.

Once you’ve found the plugin causing the error, update it or remove it entirely.

If security-related fixes don’t work, the next steps address server configurations and file settings.

5. Temporarily disable CDN

A content delivery network (CDN) stores cached copies of your site across multiple servers, and outdated or misconfigured cache can lead to a 403 status code.

If your website uses a CDN, temporarily turn it off to check if it’s serving the error instead of your origin server. Hostinger automatically enables the in-house CDN for the Business web hosting plan and above. To disable it in hPanel:

  1. Go to Performance → CDN.
  2. In the CDN status section, hit Disable.
  1. If this resolves the problem, keep the CDN disabled temporarily and contact our support for further troubleshooting.

6. Restore the .htaccess file

A corrupted or misconfigured .htaccess file can apply incorrect server rewrite or access rules, blocking visitors and returning a 403 Forbidden error.

If recent changes or malware have altered your .htaccess file, replace it with a clean version. If you’re using Hostinger, you can create a new .htaccess file through hPanel’s File Manager:

  1. Go to Files → File Manager in your website dashboard.
  2. Open the public_html directory and locate the .htaccess file.
  3. Right-click the file and select Download to create a backup.
  1. Delete the current .htaccess file.
  2. Click New file and name it .htaccess without any extensions.
  1. Paste the following default code and save the file:
# Enable URL Rewriting
RewriteEngine On
# Rewrite rule to redirect requests to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

For WordPress websites, you can also regenerate the file without using File Manager:

  1. Log in to your WordPress dashboard.
  2. Go to Settings → Permalinks.
  3. Hit Save Changes without modifying any settings.

After restoring .htaccess, try accessing your site again. If the error disappears, the file was likely the cause.

7. Reset file and directory permissions

File permissions control access to your website’s data. When a file is too restrictive, the server blocks access for security reasons, resulting in a 403 Forbidden error.

If your file permissions are incorrect, you can easily reset them in just one click using Hostinger’s built-in Fix File Ownership tool:

  1. In hPanel, search for Fix File Ownership.
  2. Select the checkbox to confirm and hit Execute. The tool will automatically set default permissions for all website files and folders.

Alternatively, you can reset file permissions manually using an FTP client like FileZilla:

  1. Connect FileZilla to your website.
  2. Right-click the public_html directory and select File Attributes.
  1. In the Numeric value field, enter 755 for directories. This lets the owner read, write, and execute the file but prevents others from modifying it.
  1. Select Apply to directories only, then hit OK.
  2. For files, repeat the process, entering 644 for the Numeric value and selecting Apply to files only. This gives the owner read and write access, while others can only read.

Once you’ve applied the correct permissions, revisit your site to confirm if the 403 error disappears.

8. Edit File Ownership

In Linux and VPS hosting environments, the ownership settings decide which users can modify or execute files. If ownership is incorrectly assigned, you may be denied access to certain resources, causing a 403 error.

This fix is more technical, as it requires using SSH to connect to your server and running Linux commands. Follow these steps to check and adjust file ownership in Linux:

  1. Connect to your server using an SSH client like PuTTY.
  2. To check the ownership of a file, run:
ls -l [file name]

The output will look like this:

-rwxrw-rw- 1 [owner][group] 22 Sep 22 10:00 filename.txt
  1. Owner and group should match your hosting account’s username. If not, use the chown command to fix it:
chown [owner][:group] [file name]

For example, if your username is John, use:

chown John filename.txt

9. Upload an index page

If your website lacks an index page, such as index.html or index.php, users may receive a 403 Forbidden error when trying to access it.

This occurs because the web server expects an index page to load by default, and without one, the server blocks access.

First, check if your homepage is named index.html or index.php. If not, rename it through your FTP client or file manager.

If the index page is missing, create one. Here’s how:

  1. Access your website’s directory.
  2. Upload or create an index.html or index.php file inside the public_html directory.
  3. After uploading, try visiting your website again to verify that it now loads the homepage correctly.

If you’re still facing issues, we have two more troubleshooting steps involving domain-related configurations that you can try.

10. Verify the A record

The A record is a type of Domain Name System (DNS) record that maps your domain to the correct IP address. If your domain’s A record points to the wrong IP, users may be denied access to your website. This leads to a 403 Forbidden response.

If you host your website with Hostinger, first find your site’s IP address by going to hPanel → Hosting Plan → Plan Details.

Then, check if your domain’s A record is pointed correctly by following these steps:

  1. Navigate to Advanced → DNS Zone Editor.
  2. Locate the A records by scanning the Type column.
  3. Examine the IP addresses listed in the Content column.
  4. If the A record doesn’t point to the correct IP address, click Edit to modify it, then click Update.

Please note that editing the A record may affect the services or subdomains using it.

If this doesn’t resolve the error or causes disruptions, consider creating a new A record instead:

  1. In the same DNS / Nameserver page, scroll up to the Manage DNS records section.
  2. Select A for the Type, then enter the correct IP address in the Points to field.
  3. Click Add Record to create the new A record.

11. Update nameservers

When you change hosting providers, your domain’s DNS records need to be updated to point to the correct nameservers. If you skip this step, users will still be directed to your old host, which leads to access issues like the 403 Forbidden error.

If you register your domain at Hostinger, here’s how to update your domain’s nameservers:

  1. Go to Domains → Domain portfolio → Manage next to your domain.
  2. Select DNS / Nameservers → DNS records.
  3. Choose Use Hostinger nameservers (recommended) if your website is with Hostinger, or Change nameservers if you host your site elsewhere.
  4. Fill in the correct nameserver details, then hit Save.

Learn how to fix the 403 Forbidden error with Hostinger Academy

If you prefer a visual guide, watch our video to discover easy-to-follow solutions for fixing the 403 Forbidden error. We’ll show you step-by-step instructions on how to apply key troubleshooting methods, like adjusting file permissions and resolving issues with the .htaccess file.

Subscribe For more educational videos! Hostinger Academy

Key takeaways

Troubleshooting the 403 Forbidden error requires a systematic approach. Start with the simplest fixes and gradually progress to more complex solutions.

  • Clear your browser cache and cookies and switch off your VPN connection to rule out local issues like outdated data or restricted access.
  • Perform malware scans and update plugins to avoid conflicts and ensure that your site is secure.
  • Reset file permissions and restore your .htaccess file to correct server-side issues that may be blocking access.
  • Verify your domain’s A record and nameservers to ensure that your domain points to the correct IP address and has the right configuration for server communication.

If the 403 problem persists, there are still some other methods worth trying:

  • Check for issues with hidden files or directories that might be causing the error.
  • Inspect the server error logs for detailed information about what might be causing the 403 error.
  • Contact your hosting provider’s support team to help you diagnose and fix the error.
Author
The author

Ariffud Muhammad

Ariffud is a Technical Content Writer with an educational background in Informatics. He has extensive expertise in Linux and VPS, authoring over 200 articles on server management and web development. Follow him on LinkedIn.

Author
The Co-author

Jordana Alexandrea

Jordana is a Senior Content Writer with a background in Information Systems. She has over five years of experience in WordPress and is casually dabbling with PHP and MySQL. Her passion for writing and technology drives her to create tutorials for anyone wanting to build their online presence. Follow her on LinkedIn.

What our customers say

Comments

Author
Erez Elias

March 04 2019

Thanks for the post. The fix for me was one of the plugins that was causing it.

Author
tuu_tuu

August 30 2019

oh, very helpful!!! thanks!

Author
Natasha

April 21 2020

FINALLY!! After going through and checking Cloudflare security settings, Sucuri firewalls, Wordfence IPs, deleting/disabling ALL plugins, checking web server resources and a whole lot more 'fixes' that so many others have recommended ... simply deleting the .htaccess file did the trick. Thank you so much for a great resource!

Author
Hayden B Dennis

May 13 2020

Thank you, this was very helpful!

Author
M-yankov

June 11 2020

I am so happy this worked and I did not contact anyone from support. * THE MORE YOU KNOW*

Author
Bernie

July 05 2020

Thanks. This has cured the error on my site. You might want to add to the article that it can take quite some time for the Permissions to change. So far mine are still going and taking over half an hour.

Author
cody

August 06 2020

good

Author
reza

August 21 2020

Just I can say Thank thank and thank you this was very helpful You are perfect

Author
Harshit Singh

August 22 2020

I had this anonymous mail from wordcamp@wordpress.com which registered itself as an admin to my website and later i am still unable to retrieve it after doing all the steps given above I need instant help

Author
Muhammad Shafiq

September 08 2020

Thank You so much. 403 forbidden issue solve: it was because the .htaccess file was corrupted. How? 1) Downloaded the .htaccess from Cpanel to have a backup of it. and then, deleted the file. 2) Generated a fresh .htaccess file, by login to the WordPress dashboard, and click on Settings › Permalinks. 3)Without making any changes I clicked on the save changes button at the bottom of the page. and it generated a fresh .htaccess file for me And my issue just got fixed

Author
Zubair

September 26 2020

Hi,i i did everything but still my issue is not resolved. What else can be the problem. Is it possible to have a problem from hosting provider?

Author
Abdul Ahad

November 13 2020

I have tried all 3 above methods to explained but my problem is still not resolve. Please let me know if any other solution is possible. 403 Forbidden Access to this resource on the server is denied!

Author
Trevor

November 18 2020

Thank you so much for this. I tried so many other "solutions" from other sites, but this went straight to the issue and I could fix it in minutes. Deleting .htaccess instantly solved my problem. You officially rock!

Author
bhumi

November 30 2020

403 Access Denied I have seen these error on my site and it's not solved by the above answer. Please help me.

Author
Panos Vas

December 09 2020

I have a website (wordpress) and this works well. If I log in as a member this works fine but if I log in as an administrator I get “Forbidden You don’t have permission to access on this server.” in front page and admin page. If I delete cookies the site is online again. I follow all step I delete .htaccess file I have change the permitions in all folders (755) and all files (644) with ftp. I have rename plugin folder, but nothing... Any idea?

Author
TRACEY TOFIELD

May 06 2021

Arts council England website keeps giving me a '403 forbidden' error- nginx. what has happened? am i blacklisted? Arts council wales and Scotland works for me -so do other websites. arghhh! help!

Author
Paul

August 03 2021

You forgot to include that wp-config.php needs to then be changed back to 600 or you'll be letting the world access your config file.

Author
hamza

March 04 2022

good work

Author
Jason

March 10 2022

Over the past couple of days, I've been seeing an increase in traffic across multiple sites I manage getting 403 - Forbidden errors, and the URLs they're generating them from are not ones the public should be able to access. It's always the same IP address with a known malicious user-agent triggering this error code and being blocked by WordFence. So I'd add that another cause of this error is your file permissions doing their job properly and stopping a bad actor from gaining unauthorized access to areas of your site or server they should not have access to.

Author
Toni

March 23 2022

Solves problem forbidden

Author
GIL

April 21 2022

I have a Wordpress site showing "Forbidded:You don't have permission to access this resource." Now I follow all the instructions here and even remove all files just leaving the domain. But still it is showing the forbidden error. Help please.

Author
Aeriel

June 04 2022

I am still getting the 403 forbidden error, even after I followed the steps you provided in the tutorial that didn't apply to WP, as I don't use WP. I don't understand why this is happening. Sometimes it appears to load fine, and other times, it gives me the 403 error. I tried using two different browsers and the same thing happens on both. Sometimes it works and other times it doesn't. Please help.

Author
bashar

October 24 2022

i cant open my website. so how can i edit public_html folder along with an index.php ??

Author
Tanjid ahomed

March 09 2023

i need 403 solution

Author
Davis

April 04 2023

I build my own website using python. As per instruction I have tried all the applicable solutions but to no avail. Initially I was redirected to the hostinger page. One info as per an article in your website was to delete the default.php file when being redirected to hostinger, but after deleting the default.php I was being shown Error: 403. Also after double clicking the "public.html" I only see my website folder and nothing other than that, I don't see .htaccess Now how do I navigate. (is .htaccess something that is present when using wordpress ? )

Author
Alex

November 15 2023

Thank you for this im a high school student and this really helped me i was wondering why my websites we'rent working thank you

Author
Samial

March 30 2024

Nice elaboration

Author
Abdimalik

July 21 2024

When I want make paypal account it shows mee 403 error

Leave a reply

Please fill the required fields.Please accept the privacy checkbox.Please fill the required fields and accept the privacy checkbox.

Thank you! Your comment has been successfully submitted. It will be approved within the next 24 hours.