yii url复制与seo友好和原始网址

时间:2018-02-22 21:54:55

标签: php yii url-rewriting

我有一个yii1应用程序。我创建seo友好的网址,它的工作原理。但是我可以用两个网址获取所有页面。这是一些例子:

http://paintballshop.hu/index.php?r=news/index

http://paintballshop.hu/kozosseg

又一个例子:

http://paintballshop.hu/

http://paintballshop.hu/index.php
谷歌表示:没有规范标签的重复页面。状态:排除 (我没有重复的内容)

这是我的网址管理员:

'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName'=>false,
    'rules'=>array(

                    'menu/<url>'=>'site/contentview',
                    'kozosseg'=>'news/index',
                    'kozossegi/<url>'=>'news/view',
                    'kapcsolat'=>'site/contact',
                    'uj-termekek'=>'site/latest',
                    '<url>'=>'products/view',
                    'paintball-termekek/<url>'=>'category/view',
                    ''=>'site/index',
    ),
),

这是我的.htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.paintballshop\.hu
RewriteRule ^(.*)$ http://paintballshop.hu/$1 [R=permanent,L] 

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php)

# otherwise forward it to index.php
RewriteRule ^(.+)$ index.php?$1 [PT,L,QSA]

0 个答案:

没有答案