How to fix the 403 forbidden error: Difference between revisions
Jump to navigation
Jump to search
(Created page with " How to fix the 403 forbidden error == Error message == When I tried to browse the website, I met the following message: <pre> Forbidden You don't have permission to access...") |
|||
| Line 36: | Line 36: | ||
Check if the syntax of .htaccess ({{kbd | key=<nowiki>/path/to/website/.htaccess</nowiki>}} ) correct. | Check if the syntax of .htaccess ({{kbd | key=<nowiki>/path/to/website/.htaccess</nowiki>}} ) correct. | ||
Example content of log | |||
<pre> | |||
/path/to/website/.htaccess: Invalid command 'Force', perhaps misspelled or defined by a module not included in the server configuration, referer: http://mywebsite.com.tw/favicon.ico | |||
</pre> | |||
Root cause: the original syntax was written for another version of HTTP server. | |||
=== More detail on HTTP server log == | === More detail on HTTP server log == | ||
Revision as of 10:48, 21 September 2022
How to fix the 403 forbidden error
Error message
When I tried to browse the website, I met the following message:
Forbidden You don't have permission to access this resource. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Troubleshooting process
Check the SELinux policy if SELinux was enabled
The result of ls -Zd should contains "httpd_sys_content_t:"
$ ls -Zd /path/to/website/ drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 /path/to/website/
Check the configuration of HTTP server
Check if home directory exists e.g. /path/to/website/ in the configuration of HTTP server. The folder location of configuration files maybe located on Template:Kdb depends on the HTTP server environment.
<Directory /path/to/website/> .. </Directory>
Check the syntax of .htaccess
Check if the syntax of .htaccess (/path/to/website/.htaccess ) correct.
Example content of log
/path/to/website/.htaccess: Invalid command 'Force', perhaps misspelled or defined by a module not included in the server configuration, referer: http://mywebsite.com.tw/favicon.ico
Root cause: the original syntax was written for another version of HTTP server.
= More detail on HTTP server log
Log files maybe located on Template:Kdb