VPS侦探论坛

标题: 为做seo这样写跳转到https会不会好点? [打印本页]

作者: oiuki    时间: 2016-5-7 14:09
标题: 为做seo这样写跳转到https会不会好点?
百度虽然说能抓取https但是网站做了两个月.也提交了还是不能收录.360可以搜录https.下面规则判定百度360等蜘蛛抓取的时候不跳转https 还有就是做了https以后xp系统会无法访问这个规则也解决了xp的问题    直接上规则
      #若请求协议是http,则继续将变量增量赋值es
        if ($scheme = 'http' ) {
            set $ssl "${ssl}es";
        }
        #若变量值为yes,即命中上述2个条件,则跳转到https
        if ( $ssl = "yes" ) {
            rewrite ^(.*)$ https://$host$1 permanent;
        }
        # ==================== 以下为新增内容 =======================
        #若UA匹配到不支持https的请求,则设置变量为n:
        if ($http_user_agent ~* "Windows\ NT\ 5.1|Windows\ NT\ 5.2|BaiduSpider|360Spider|YisouSpider|Sosospider|sogou spider") {
            set $ssl "n";
        }
        if ($scheme = 'https' ) {
           set $ssl "${ssl}o";
        }
        #若变量值为no,即命中上述2个条件,则跳转到http
        if ( $ssl = "no" ) {
            rewrite ^(.*)$ http://$host$1 permanent;
        }
如果有大神有更好的办法.把规则共享出来
作者: licess    时间: 2016-5-7 18:29
蜘蛛的口味没法说




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4