What is 403 error for Wordpress

What is 403 error & How to solve 403 error?

Introduction

If you read this post, probably you are getting an error like “403 Forbidden – you don’t have permission to access ‘/’ on this server”. You are receiving a 403 response code from the server and you want to learn the reason WHY?

Do not worry about that this can happen frequently almost all web administrators get this 403 error.

Forbidden: You don't have permission to access [directory] on this server

Within this tutorial, you are going to see the possible reasons cause 403 error and the ways to solve 403 forbidden error. Here we are going to follow a method to solve this failure for a WordPress website but you should follow the logic shown in here for different CMS frameworks.

What are the requirements?

Before starting this tutorial you are going to need:

  • Hosting admin control panel or ftp access

What is 403 error?

Before solving the error we should have a better understanding of 403 error. 403 is an HTTP status code which returns from the server. If you get 403 status code, the server tries to tell you that you are trying to visit an address on the server that you don’t have permission.

Meanwhile, you should be aware that the 403 error message can change depending on the server platform. Here are some of 403 error message samples which all saying the same thing.

  • Forbidden: You don’t have permission to access [directory] on this server
  • HTTP Error 403 – Forbidden
  • 403 forbidden request forbidden by administrative rules
  • 403 Forbidden
  • Access Denied You don’t have permission to access

Let’s check out the reasons now…

What are the possible reasons of 403 error?

Getting a 403 error while developing your website can be very disturbing. Sometimes you spend hours and hours on developing, because of a small fault, everything becomes annoying. But now at least you are aware that you are trying to reach an address which you don’t have permission.

There are some possible reasons that you might consider:

  • Wrong file or folder permissions
  • Wrong .htaccess file settings

The reasons for 403 error chance accordme circumstances. Rarely this kind of error messages due to updates of system settings on your hosting company.

Now we have information about the possible reasons, we can move on to solve the 403 error.

How to solve 403 error?

According to our analysis usually, people who use WordPress have this error. So we decided to prepare tutorial which is mostly based on WordPress but these methods are also can be applied to other frameworks too.

Step 1 – Checking .htaccess file

It is very normal that you don’t know what is .htaccess file and where it can be found. Because; on most of the servers it is hidden inside HTTP root folder of your website. Indeed .htaccess is a configuration file which controls an apache based web server for how it will behave. If you use cPanel or similar file management tool you can see it as below:

Unhide System Files

.htaccess Cpanle File Manager

Almost in every WordPress installation, you can find the .htaccess file under the public_html folder. If there is something wrong about the .htaccess file or if it is missing you must create a new one by hand. When you find your .htaccess file all you need to do:

  • First backup your .htaccess file with a different name or you can download it to your computer.
  • Then delete the .htaccess file under public_html
  • Visit the page which you have met with 403 error. If this works, that means your .htaccess file was broken or has included some syntax errors.
  • If you are using a WordPress; you can create a new .htaccess with the help of information which you can get from admin panel “Settings > Permalinks”.
  • Just save the settings without any change. So this will create new and fresh .htaccess file under public_html folder

If you are using a different framework you can check their support to find default .htaccess code. But sometimes even the settings seem ok, you may continue to have this error when you put right htaccess. This happens because of some incompatibility between your server settings and your .htaccess. To find the problem :

  • Apply the first 3 steps above.
  • Create a empty htaccess file
  • Copy the lines one by one from default one, and check the target page after changing and saving the file.
  • Continue to operation until you start to see the 403 error again.
  • Remove the code and try other lines.
  • Inform your server administrator, hosting provider or your scripts support team about the problematic code on .htaccess file.

Even after removing .htaccessfile, your 403 error is still on the page, possibly you have some problem on file permissions. So don’t give up an move on permission settings solution.

Step 2 – Rearranging file permissions

  • Connect your FTP account via FileZilla
  • Open your root folder of hosting account
  • Find the folder which contains html files of your website – generally, it is named as public_html – and right click will open a contextual menu which has file permissions item in it. You should click file permissions.
  • Enter 755 for the number value and make sure apply all subfolders option is selected. Also you should select only apply to folders option.

How to edit file permissons

  • When the operation is done you should repeat the same action but this time value must be 644 and only apply to files option must be selected.

Changing Permissons On Filezilla

After that, you should try to visit your website and check if it is still giving 403 error or not. If you have the same 403 error let’s continue to step 3.

Step 3 – Disabling WP Plugins

If still you see the 403 error on your website and you are using WordPress, a broken plugin may be the reason. To understand if the reason is a plugin or not we should disable all plugins. You can do it via WP admin panel > Plugins menu or you can rename plugins folder under wp-content folder. When you check the website if the problem doesn’t exist this means a broken or outdated plugin is the reason. To find the broken plugin you can follow the renaming method for all plugin folders one by one and after each renaming, you should check the website. If you get the 403 error l after your last modified plugin, that means this plugin have some problem. So you can update or delete it to solve the 403 error.

If your 403 error still exists after applying all these steps you should ask your hosting provider if there is a problem on server level.

Conclusion

We tried to solve 403 error problem based on a WordPress website. This kind of errors can be frustrating because it stops the website and you loose visitors and ranking. If you follow the steps described in this tutorial your site will be back again.

Leave A Comment?