403 Forbidden or No Permission to Access
In this article, we will discuss the following topics:
- What does 403 Forbidden mean? ⤵
- What causes 403 Forbidden errors? ⤵
- Other possible causes of 403 Forbidden errors ⤵
What does 403 Forbidden mean?
A 403 Forbidden error means that you are not allowed or do not have permission to view the requested file, resource, or page you are trying to view in a browser. A 403 error page is presented in several ways.
- 403 Forbidden
- 403. That's an error. We're sorry, but you do not have access to this page.
- Error 403
- Error 403 - Forbidden
- Forbidden
- Forbidden: You don't have permission to access [directory] on this server.
- HTTP 403
- HTTP Error 403 - Forbidden
While sometimes this is intentional, other times, the issue is on your end.
What causes 403 Forbidden errors?
There are many possible causes of 403 Forbidden errors on a website. Here are some of the most common ones.
File Permissions
The files and folders stored on your website each have their own permissions. Permissions can control who can access and view the files or folders on your website. The 403 Forbidden error could mean your file has incorrect or bad permissions.
A string of 3 numbers denotes the permissions. File and folder permissions should show the following:
- WordPress site files must be 644 or 640.
- Directories and WordPress folders must be 755.
- Executable scripts within the cgi-bin folder must be 755.
- Images, media, and text files like HTML should be 755 or 644.
Hidden Files (Dot Files)
Suppose you see "client denied by server configuration" in your Error Logs. In that case, this usually means bad file permissions, but it could also mean that the visitor is trying to look at a hidden file, like the .htaccess file. You cannot look at that file or any file name that starts with a dot in your browser.
For example, https://example.com/.htaccess will always result in a 403 error.
To resolve a 403 Forbidden error caused by permissions:
- Log in to cPanel.
- Navigate to the Files section, then click on the File Manager icon.
- Locate and click your website's directory (also known as the document root) from the list. For this example, we will use public_html.
- Once you see your website's files and folders, click the Settings button at the top-right menu.
- In the pop-up window, select Show Hidden Files (dotfiles), then click Save.
- Once all files are displayed, check the Permissions column on the right. Scroll down and see if they follow the correct permissions for files and folders as stated above.
- If any of the files or folders seem to have different permission, you may go ahead and change them to default by double-clicking the set of numbers. Click Save once done making the update.
For more information on how to change file permissions in the File Manager, please check our article, How to change permissions (chmod) of a file.
Missing or broken .htaccess file
The .htaccess file could also be the issue itself. Most websites, especially those built with a CMS like WordPress, have a .htaccess file. If you made changes to this file or it is missing for some reason in your website directory, your site would then display the 403 error page. If this happens, you need to update the .htaccess file again or create a new one to resolve this .htaccess error.
Depending on what CMS or application was used to create your website, the script or code in a .htaccess file varies. Please check out the article, Common Default .htaccess Information, for more information about default .htaccess scripts.
To fix a 403 error page caused by a misconfigured or missing .htaccess file:
- Click your website's CMS in the Common Default .htaccess Information article.
- Copy the CMS script from the pop-up window. In this example, we will use WordPress.
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
- Go to your File Manager and paste the code into your .htaccess file. For instructions on how to update your .htaccess file, please check the article, How to Edit .htaccess in cPanel's File Manager.
If the .htaccess file is missing from your File Manager, create a new one.
- Click the + File button located in the top-left menu.
- Enter .htacess in the pop-up window, then click on the Create New File button.
- Open your new .htaccess file and paste the script you copied from the support article as instructed above.
Plugin issues (for WordPress websites)
WordPress plugins are great for adding features and functionality to your website. Still, suppose they're not configured correctly or incompatible with another plugin. In that case, they could cause you to see a 403 error message on your website. This WordPress Plugins article provides tips on understanding how you can identify a bad plugin.
The Plugins Advice page offers some general advice on some commonly used plugins and lists banned plugins. Just take note that HostGator cannot provide direct support for the plugins discussed.
To resolve a 403 Forbidden error caused by WordPress plugins:
Error 403 caused by the plugins can be fixed by disabling and enabling the plugins one by one. You will then identify which of the installed plugins is/are causing the error. Here are helpful articles to guide you in disabling/enabling your plugins.
Still getting the 403 Forbidden Error page?
Here are 'other' possible causes.
- The account may have IP Deny rules. You can check in the cPanel to make sure you are not blocking your own IP address. Here is how you can check it in cPanel: How Do I Deny an IP Address Access?
- You may have changed the Index Manager to 'No Indexing.' This will cause a 403 error if there is no correct index page to load. So you can check if the Indexing has been altered, check out these helpful articles below:
- The error could be caused by our mod_security rules, which have something to do with the web application firewall. Please contact us via phone or chat for assistance.
Hey, trying to access other websites but getting a 403 Error page?
As discussed above, a 403 error means that you do not have permission to view the website. If you're trying to access other websites and you're getting the 403 Forbidden Error page, here are a few ways to resolve it.
- You may need to clear your browser's cache because when you visit a site, sometimes it displays a saved copy of the site. Clearing your cache may resolve your issue, especially without going through further troubleshooting.
- Check the website's status or reach out to them on social media, such as Twitter or Facebook. They may be aware of the issue because multiple people are experiencing it, or you can find out how to get support if you're the only one.
- The link may be incomplete or incorrect. As we discussed above, you can't view any files that begin with a dot(.) such as .htaccess in the browser. You also may not have the complete URL or web address.
For example, https://www.facebook.com/HostGator/photos/a.10150093510632092/ is not a valid link because it stops at the directory /a.10150093510632092. However, the full link - https://www.facebook.com/HostGator/photos/a.10150093510632092/10158726693822092 - works because it resolves to a file that is viewable to the public.
- Were you able to view this website before and can't now? Maybe you're not logged in, or you're not logged into the right account. Navigate to the login page to see which account you're logged into or login if you're not already.
Related Articles
For more references on Permissions, please refer to the support guides below.