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]
精彩评论