NodsDorf Posted March 19, 2012 Share Posted March 19, 2012 Just noticed this today in a SEOmoz report. We are seeing 302 errors from redirection to the cookie usage page as the bots are trying to follow the buy now buttons on our site. Shouldn't those all be nofollow? Maybe there is a mod that deals with this if so I missed it, but nofollow should be part of basic code when generating action buttons.... I think. I think it will be a fairly simple fix, if I find a solution I'll post it, or if you have one I'd appreciate the code. Thanks, Don Link to comment Share on other sites More sharing options...
♥kymation Posted March 19, 2012 Share Posted March 19, 2012 The cart and checkout pages should be in your robots.txt file so the bots will leave them alone. Having them redirected to the cookies page is actually harmless, so I wouldn't put too much effort into fixing this. Regards Jim See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
NodsDorf Posted March 19, 2012 Author Share Posted March 19, 2012 Hi Jim, Indeed shopping cart / checkout pages are blocked via robots.txt, but the URL being displayed on the page is like href="http://www.rubberstore.com/catalog/as568-nitrile-c-33_39_43.html?products_id=29&action=buy_now&sort=3a If nothing more its annoying to see kathousand errors via Seomoz reports, I just need to figure out how to add the nofollow attribute in the product_listing where the button is generated. Link to comment Share on other sites More sharing options...
♥kymation Posted March 19, 2012 Share Posted March 19, 2012 Try something like this: if( isset( $_GET['action'] && $_GET['action'] != '' ) { // Output a noindex/nofollow tag here } Regards Jim See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
NodsDorf Posted March 22, 2012 Author Share Posted March 22, 2012 HI Jim, Thanks for the idea there, I got around to trying to fix this today and I am coming up blank on where to put the nofollow to get it to parse correctly. In /includes/modules/product_listing.php I'm assuming I need to edit this code: case 'PRODUCT_LIST_BUY_NOW': $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing[$x]['products_id'])) . '</td>'; break; However no matter were I try and put rel="nofollow" the link is not coming out correctly. I don't really think I need to check to see if there is an action set, so I was just trying to stick the tag in there. I can't think of any reason for these buttons not to have a no follow tag, since the product image and the product name already link to the product page, and the button will always link to "add to cart" action. Link to comment Share on other sites More sharing options...
♥kymation Posted March 22, 2012 Share Posted March 22, 2012 I think this will work. Not tested, so beware bugs: $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']), NULL, array('params'=>'rel="nofollow"')) . '</td>'; Regards Jim See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
NodsDorf Posted March 22, 2012 Author Share Posted March 22, 2012 Thanks Jim I'll let you know how it goes when I get into work tomorrow, really appreciate the continued help. Link to comment Share on other sites More sharing options...
NodsDorf Posted March 23, 2012 Author Share Posted March 23, 2012 Jim that was absolutely spot on I was thinking that you could add the rel=nofollow into one of the all ready defined functions. Good call... and off the top of your head very nice! <span class="tdbLink"><a id="tdb3" href="http://www.rubberstore.com/test/catalog/as568-nitrile-c-33_39_43.html?products_id=31&action=buy_now&sort=2a" rel="nofollow">Buy Now</a></span> Thank you very much! Link to comment Share on other sites More sharing options...
hobievi Posted February 8, 2013 Share Posted February 8, 2013 Option 1) Go to Google Webmasters: https://www.google.com/webmasters/tools/crawl-url-parameters Disable "action" there Option 2) Add this to your robots.txt: Disallow: /*action=* Thanks, Yavuz Link to comment Share on other sites More sharing options...
♥kymation Posted February 8, 2013 Share Posted February 8, 2013 Option 2 won't reliably work. The robots.txt standard does not allow wildcards in file/directory names. Some search engines might allow them, but they don't have to. Regards Jim See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Jack_mcs Posted February 9, 2013 Share Posted February 9, 2013 Google, Bing and yahoo allows wildcards. Once they do, all of the others usually will and I suspect they already do. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.