• 记一次对网站的SEO优化改造


      网站是用vue搭建的,由于vue属于客户端渲染,对SEO不友好,所以进行以下操作:

             1.改成了vue-ssr服务端渲染,爬虫已经可以爬取到网页上的内容。但是代价是代码很难写,对前端人员技术要求增加。并且要用vue-meta组件,做到动态设置页面title,content

             2.打开搜索资源平台:https://ziyuan.baidu.com/pressure/index,可以看到抓取频次,发现百度已经不到网站内来抓取。

             3.检查一下网站根目录中的robost.txt,如下内容:       

        User-Agent: *
        Allow: /
        Disallow: /sciadmin
        Disallow: /manage
        Disallow: /users

                代表禁止爬取 sciadmin,manage,users的路由,其他的都允许。

           4. 百度搜索资源平台提交资源,有三种提交方式,我都做了一遍

              (1)sitemap提交:写一个网站地图,提交百度搜索资源平台,内容如下:

              

    <!DOCTYPE html><head>
    <title>http://www.sciencemate.com - 网站地图</title>
    <meta http-equiv="Content-type" content="text/html;" charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <style>a:link{text-decoration: none;}a:visited{text-decoration:none;}a:active{text-decoration:none;}
    body{font-family: Arial, "微软雅黑";font-size: 13px;}
    ul, li{margin:0px; padding:0px; list-style:none;}ul{width:90%;margin-left: auto;margin-right: auto;}.title{width:100%;font-size: 18px;text-align: center;}
    .lks a {font-size:13px;border:1px solid #e4e4e4;width:150px;height:30px;line-height:30px;float:left;padding-left:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
    .lks span {font-size:10px;width:40px;background-color:#e4e4e469;margin-bottom:3px;text-align:center;border-left:1px solid #e4e4e4;float:left;border-top:1px solid #e4e4e4;border-bottom:1px solid #e4e4e4;}
    h2,h5{margin:5px}.lks {line-height:30px;font-size:16px;height:32px;width:200px;text-align:left;float:left;margin-bottom:3px;}
    @media only screen and (max- 720px){.lks{width: 50%;}.lks a{width: 60%;}}</style>
    </head><body align="center"><div style="display: table; 100%;max- 1130px;margin: auto;">
    <ul><li class="title"><h2>
    <img src="http://www.sciencemate.com/favicon.ico" style="max-height:30px;max-30px;vertical-align: sub;margin-right: 15px;">www.sciencemate.com</h2>
    <h5>网站地图(2020-12-12 11:35:44)</h5></li>
    <li class="lks"><span>1</span><a href="http://www.sciencemate.com/" title="首页" target="_blank">首页</a></li>
    <li class="lks"><span>2</span><a href="http://www.sciencemate.com/team" title="课题主页" target="_blank">课题主页</a></li>
    <li class="lks"><span>3</span><a href="http://www.sciencemate.com/meeting/home" title="学术会议" target="_blank">学术会议</a></li>
    <li class="lks"><span>4</span><a href="http://www.sciencemate.com/apply" title="奖项奖励" target="_blank">奖项奖励</a></li>
    <li class="lks"><span>5</span><a href="http://www.sciencemate.com/researchGroup/energy.jlu.edu.cn/home" title="金属催化与能源材料" target="_blank">金属催化与能源材料</a></li>
    </ul></div><br><br><br><br><br><br></body></html>

            (2)API提交

                在本地新建一个urls.txt,内容如下

    www.sciencemate.com/team;
    www.sciencemate.com/researchGroup/energy.jlu.edu.cn/home

            doc命令执行:curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls?site=www.sciencemate.com&token=63ylLXRtDUrbXC56"

           (3)手动提交

           

                  在此处填写链接地址。

                提交后,第二天打开资源搜索网站查看抓取频次,发现百度已经来抓取了。

          5.还可以调整一下抓取频次上限,之后大概每天百度都会过来爬取五六次。

            

             6.由于整个网站的权重是0,也没有什么外链,大概过了一个半月百度才收录了目标页面,而且通过关键词可以搜索到。http://www.sciencemate.com/researchGroup/energy.jlu.edu.cn/home ,可能与这个url级数太多也有关系,总之最后目标达到了。

               

  • 相关阅读:
    POJ1769 Minimizing maximizer(DP + 线段树)
    ZOJ3201 Tree of Tree(树形DP)
    POJ3613 Cow Relays(矩阵快速幂)
    POJ3635 Full Tank?(DP + Dijkstra)
    ZOJ3195 Design the city(LCA)
    POJ3368 Frequent values(RMQ线段树)
    POJ3686 The Windy's(最小费用最大流)
    HDU4871 Shortest-path tree(最短路径树 + 树的点分治)
    POJ3013 Big Christmas Tree(最短路径树)
    Gym100685G Gadget Hackwrench(倍增LCA)
  • 原文地址:https://www.cnblogs.com/yina-526/p/14234515.html
Copyright © 2020-2023  润新知