php - correct htaccess query string code -
is correct code htaccess setting header noindex nofollow rewritecond %{query_string} (^|&)cart? [nc] rewriterule .* - [e=my_set_header:1] header set x-robots-tag "noindex, nofollow" env=my_set_header so following url cannot indexed search engines. http://www.mysite.com/cart?qty=1&id_product=8&token=7775324f4cd8c884155af53ca90e44ad&add actually moz analytics crawling these types of url in <a href="http://www.mysite.com/cart?qty=1&id_product=8&token=7775324f4cd8c884155af53ca90e44ad&add">add cart</a> as duplicate page content. dont know why these url add cart url , these nothing content. also need suggestion online tutorial on playing htaccess . thanks. /cart isn't query_string request uri. can use rule instead: rewritecond %{query_string} .+ rewriterule ^cart/?$ - [e=my_set_header:1]