.htaccess & 403 Forbidden
The 403 Forbidden Error may show if your
.htaccess file or the
public_html/ folder is inaccessible due to file permissions.
The 403 Forbidden Error may appear under the following error messages:
- Forbidden. You don't have permission to access this directory on this server.
- Forbidden. You don't have permission to access this resource.
- HTTP Error 403 – Forbidden
- Error 403 – Forbidden
- 403 Forbidden: Request forbidden by administrative rules.
- Access Denied: You don't have permission to access
- Incorrect file or directory permissions
index.htmpage in the
- If you use WordPress, faulty WordPress plugins may cause the error
Fix 403 Forbidden Error
Create the public folder
Verify that you have the public directory created:
/usr/share/nginx/html/for nginx. Others may be
Create the index page
Navigate to the public directory, i.e.
public_html/, and check that you an index file:
Check file and directory permissions
Generally, use the following files and directories permissions:
- 755for directories
- 644for static content (images,
- 700for dynamic content (PHP files)
Set the correct directory permissions for the public directory, the
chmod 755 public_html/
Set the correct file permissions for the
chmod 644 .htaccess
Check the .htaccess file
Certain directives placed in the
.htaccess file may cause the 403 Forbidden Error.
Empty the entire
.htaccess file to determine if the error is caused by the directives. Keep the file using the permissions suggested above (644).
Disable WordPress plugins
Faulty WordPress plugins may be the cause for the 403 Forbidden Error.
Disable newly installed plugins or disable plugins one by one until the error is triggered again.