wordpress wp-includes阻止目录访问

问题描述 投票:0回答:1

我最近检查了很多wp站点,他们允许从include文件夹访问该文件,并在其上显示错误消息

路径是

wp-includes/customize/class-wp-customize-background-position-control.php

错误信息

Fatal error: Class 'WP_Customize_Control' not found in /home4/pcc/public_html/project/autosite/wp-includes/customize/class-wp-customize-background-position-control.php on line 1

理想情况下,它不应该直接访问

我在我的htaccess中使用了这个,但仍然是同样的错误

Options All -Indexes
  • 他们也在谷歌爬行。
wordpress .htaccess directory fatal-error
1个回答
0
投票

取消索引作业将无法正常工作,因为它是所有WordPress安装中的一个众所周知的文件,而Options -Indexes并没有阻止用户访问它。

将.htaccess文件放在wp-includes文件夹中,其中包含以下内容。当有人试图访问wp-includes文件夹及其子文件夹中的.php文件时,它将返回403状态代码。

<Files *.php>
deny from all
</Files>
© www.soinside.com 2019 - 2024. All rights reserved.