+
+
  • 简体中文
  • Typecho在Nginx下设置301重定向至主域名  typecho nginx 重定向 第1张

        首先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。

    版权声明 : 本文未使用任何知识共享协议授权,您可以任何形式自由转载或使用 / Article Is Not Licensed Under Any Creative Commons License, And You May Freely Reprint Or Use It In Any Form
    上一篇
    8632浏览
    0评论
    三篇用户隐私保护条款范本
    • 2020-04-05
    首先typecho在nginx下的默认伪静态规则如下:
    下一篇
    5773浏览
    113评论
    彻底解决Windows2003x86证书错误问题
    • 2020-04-19
    首先typecho在nginx下的默认伪静态规则如下:
    发布评论 / 取消回复

    二维码

    感谢您的赞助