【发布时间】:2022-01-28 21:42:53
【问题描述】:
我今天正在更新我的 wp-config 文件,我发现在末尾添加了很多来自以前主机的随机内容。我删除了它,因为它没有必要,但我也注意到了这个我不确定的代码。我认为第一部分是出于 SSL 原因,但我认为这是在其他地方处理的,而不是在我的配置文件中?还是我弄错了?我在 ahrefs 中进行研究时注意到我的网站存在与 http > https 相关的重定向链,所以我不确定这是否与此有关?
其余的我完全不明白。任何帮助将不胜感激。
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS'] = 'on';
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
/**
* Include tweaks requested by hosting providers. You can safely
* remove either the file or comment out the lines below to get
* to a vanilla state.
*/
if (file_exists(ABSPATH . 'hosting_provider_filters.php')) {
include('hosting_provider_filters.php');
}
感谢您的帮助。
【问题讨论】: