首先typecho在nginx下的默认伪静态规则如下:
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
} 我们需要在后台将域名设置为https://www.onx8.com,然后在默认伪静态规则前加入下列的规则即可。
if ( $host != 'www.onx8.com' ) {
rewrite ^/(.*)$ https://onx8.cn/$1 permanent;
}修改完重启nginx生效,不管用户以后访问的是哪个网址,都会默认访问https。
感谢您的赞助
发布评论 / 取消回复