php wordpress ssl
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php wordpress ssl相关的知识,希望对你有一定的参考价值。
<?php
//in config.php
define('FORCE_SSL_ADMIN', true);
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
//in htaccess
//plugin Really Simple SSL
/*
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>*/
以上是关于php wordpress ssl的主要内容,如果未能解决你的问题,请参考以下文章