WordPress HTTPS配置优化建议

// 在数据库配置之后,安全密钥之前添加:
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';

if ($host === ‘www.yuebin.uk’ || $host === ‘yuebin.uk’) {
define(‘WP_HOME’, ‘https://www.yuebin.uk’);
define(‘WP_SITEURL’, ‘https://www.yuebin.uk’);
define(‘FORCE_SSL_ADMIN’, true);
} else {
define(‘WP_HOME’, ‘http://’ . $host);
define(‘WP_SITEURL’, ‘http://’ . $host);
define(‘FORCE_SSL_ADMIN’, false);
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *