yii 伪静态规则问题 [ 未指定版本 ]
我写的/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>',
),
),
共 1 个回答
-
<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>
共 1 条回复
jiege 陕西西安
注册时间:2011-04-02
最后登录:2014-07-03
在线时长:0小时40分
最后登录:2014-07-03
在线时长:0小时40分
- 粉丝1
- 金钱250
- 威望0
- 积分250