Home > Common Problem > body text

How to solve the 403 error on the web page?

Release: 2020-03-10 09:57:05
Original
29782 people have browsed it

How to solve the 403 error on the web page?

Sometimes when we log in to certain websites, a 403 Forbidden error will pop up suddenly, causing the website to be unable to log in. Here is how to deal with this situation.

Methods to solve 403 forbidden errors:

1. Rebuild dns cache

For some common 403 forbidden errors, it is recommended that the first thing you try is to rebuild dns cache. Enter cmd, then enter ipconfig /flushdns. If that doesn't work, you need to parse the homepage in the hosts file.

2. Modify the folder security attributes

Use the following command to modify the folder security attributes

chcon -R -t httpd_user_content_t public_html/
Copy after login

Analysis of the command used:

ls -Z -d public_html/
Copy after login

3. About apache caused The solution to the 403 forbidden error

Open the apache configuration file httpd.conf and find this code:

Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Copy after login

Sometimes after configuring php, the "Deny from all" has rejected all connections. Change this line to "allow from all". The modified code is as follows, and the problem is solved.

Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Copy after login

4. Solution to 403 Forbidden error in HawkHost space

Sometimes Mod security is installed on the shared server, and when the URL contains other sensitive characters such as "%", , will be blocked by Mod security

How to solve HawkHost 403 Forbidden error:

Add the following code in the .htaccess file:

SecFilterEngine Off
SecFilterScanPOST Off
Copy after login
Copy after login

Put it directly in the root directory of the website Or the directory where the program is running.

5. About the solution to the 403 Forbidden error caused by WordPress

For some blogs built using the WordPress management program, you need to modify the .htaccess file and add the following content at the end. , in fact, it is disable mod_security

SecFilterEngine Off
SecFilterScanPOST Off
Copy after login
Copy after login

In addition, dedecms may need to add another one so that the default access is the DirectoryIndex index.html of the index.html file.

Modify the .htaccess file, upload the file, and then reopen the URL where 403 Forbidden appeared before and the error will no longer occur.

The above is the detailed content of How to solve the 403 error on the web page?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template