2013-12-16 14:40:56 5103次浏览 1条回答 0 悬赏 0 金钱

我写的/list.html?category=33&page=2 这种伪静态规则会被百度统计提示:“在静态页面上使用动态参数,会造成spider多次和重复抓取”,所以我想写成/list/category/33/page/2.html 类似这种方式的或者论坛那种方式也可以,求指教

我最初伪静态配置:
服务器环境是Nginx

    'urlManager' => array(
      'urlFormat'=>'path',
      'urlSuffix' => '.html',
      'showScriptName'  =>false,
      'caseSensitive'   =>false,
      'rules'=>array(

        '<_c:\w+>/<id:\d+>'=>'info/<_c>',
        '<_c:\w+>'=>'info/<_c>',

      ),
    ),

  • 回答于 2013-12-16 16:22 举报
    <span class="php-hl-reserved" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; vertical-align: baseline; color: black;">return</span> <span class="php-hl-reserved" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; vertical-align: baseline; color: black;">array</span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">(</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">
        ......
        </span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">components</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-reserved" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; vertical-align: baseline; color: black;">array</span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">(</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">
            ......
            </span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">urlManager</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-reserved" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; vertical-align: baseline; color: black;">array</span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">(</span>
                <span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">urlFormat</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">path</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
                </span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">rules</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-reserved" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; vertical-align: baseline; color: black;">array</span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">(</span>
                    <span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">post/<id:\d+>/<title:.*?></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">post/view</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
                    </span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">posts/<tag:.*?></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">post/index</span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
                    </span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;"><controller:\w+>/<action:\w+></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">=></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-string" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;"><controller>/<action></span><span class="php-hl-quotes" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: red;">'</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
                </span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">)</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
            </span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">)</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
        </span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">)</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">,
    </span><span class="php-hl-brackets" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: olive;">)</span><span class="php-hl-code" style="border: 0px; font-family: inherit;font-size:undefined; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; color: gray;">;</span>
    

    http://www.yiichina.com/blog/final.url

    1 条回复
    回复于 2013-12-16 16:24 回复

    呃。。。。。。。。。

您需要登录后才可以回答。登录 | 立即注册
jiege
见习主管

jiege 陕西西安

注册时间:2011-04-02
最后登录:2014-07-03
在线时长:0小时40分
  • 粉丝1
  • 金钱250
  • 威望0
  • 积分250

热门问题