403 Forbidden error message?
Overview
The 403 Forbidden error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason.This article contains basic troubleshooting instructions for 403 Forbidden errors.
Symptom
You get the following error when you try to visit a web page:
Figure 1.
Causes and Solutions
There are three common causes for this error. Here they are listed from most likely to least likely.Empty html directory
Make sure that your website content has been uploaded to the correct directory on your server. Remember to replace example.com with your own domain name.- (gs) Grid-Service: /domains/example.com/html/
- This is the path you will use for FTP. However, the full path to your website content is
/home/00000/domains/example.com/html/
. The 00000 is your site number. See this article for details.
- This is the path you will use for FTP. However, the full path to your website content is
No index page
The home page for your website must be calledindex.php
or index.html
.To resolve this error, upload an index page to your
html
directory.If you already have a home page called something else – home.html for example – you have a couple of options:
- Rename your home page to
index.html
orindex.php
. - Set up a redirect on the index page to your real home page. See How do I redirect my site using a .htaccess file? for details.
- Set a different default home page in your .htaccess file. Javascript Kit has a good example.
Permissions and ownership errors
A 403 Forbidden error can also be caused by incorrect ownership or permissions on your web content files and folders.Permissions
Rule of thumb for correct permissions:- Folders: 755
- Static Content: 644
- Dynamic Content: 700
TIP:
Linux permissions can be represented with numbers, letters, or words. They also include an entry for Owner, Group, and Everyone.
Most FTP programs allow you to change permissions on a file or
folder; see your FTP program documentation for details. You can also
change permissions through SSH with the chmod command. See Common SSH Commands for details.Linux permissions can be represented with numbers, letters, or words. They also include an entry for Owner, Group, and Everyone.
- 755 stands for Owner: read, write, execute; Group: read, execute; Everyone: read, execute
- 644 stands for Owner: read, write; Group: read, Everyone: read
- 700 stands for Owner: read, write, execute; Group: (none); Everyone: (none)
Ownership
In Linux file structures, every file and folder is assigned to an Owner and a Group. The correct owner and group for your server are as follows, listed like this:owner:group
- (gs) Grid-Service – note that example.com is your primary domain:
- /domains/example.com/ – example.com:example.com OR example.com:www-data
- /domains/example.com/html/ – example.com:example.com OR example.com:www-data
- /domains/example.com/html/index.html – example.com:example.com
0 comments:
Post a Comment
Thanks for commenting. I will Reply you soon