干净的Wordpress网站位于后面的loadpalancer代理,为wp.mydomain.com提供通配符SSL,但我没有参与其configuration。 基于CentOS 7.1的WP服务器,安装了Apache。 我为该域创build了简单的虚拟别名:
<VirtualHost *:80> ServerName wp.mysite.com DocumentRoot "/var/www/wp.mysite.com/public_html" <Directory "/var/www/wp.mysite.com/public_html"> Options Indexes FollowSymLinks AllowOverride All Order Deny,Allow Allow from all </Directory> DirectoryIndex index.php index.phtml index.html index.htm <IfModule mpm_peruser_module> ServerEnvironment apache apache </IfModule> ErrorLog /var/www/wp.mysite.com/error.log CustomLog /var/www/wp.mysite.com/access.log combined </VirtualHost>
网站的HTTP版本一切正常,但没有HTTPS版本。 加载网站时出现“ 混合内容”问题。 此外,我不能使用WPpipe理员,这让我陷入redirect循环的问题。 我已经将下一部分代码添加到wp-config.php中:
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; define('WP_HOME','https://wp.mysite.com'); define('WP_SITEURL','https://wp.mysite.com');
谢谢。
混合内容意味着,虽然通过https连接了一些页面元素,如图像或链接的CSS文件,并使用http获取字体 – 右键单击图像上的“检查元素”,并查看CSS文件中的redirect循环可以禁用wp_config文件中的USE_SSL = true为FALSE。 希望有所帮助。