开发者

How can I write redirect rule to prevent duplicate content from comment page

Please, how can I use redirect each of the following (using htaccess):

http://www.example.com/jane-doe-online-5026?comments=true
http://www.example.com/jane-doe-online-5026?postcomment=true
开发者_开发百科

To:

http://www.example.com/jane-doe-online-5026

Note: It's a Wordpress blog and the duplicates are showing on Google Webmaster tools - under HTML suggestions.


Try following code in your .htaccess file:

Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteCond %{QUERY_STRING} ^(post)?comment(s)?=true$
RewriteRule . %{REQUEST_URI}? [L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜