开发者

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

开发者 https://www.devze.com 2023-03-06 13:35 出处:网络
Please, how can I use redirect each of the following (using htaccess): http://www.example.com/jane-doe-online-5026?comments=true

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

精彩评论

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