If you are using Magento 1.5 or 1.6 , and your product pages are all going to 404 Not Found Page, then thats a headache for sure. We just spent an hour trying to fix this. And finally found the bug!
It was report_event_types .
Last week, we optimized the Magento Database and cleared all the report events tables and log tables. And then we saw that all product pages were sending me to 404 not found error.
So, here is the fix :
Goto phpmyadmin and run this command :
-- Dumping data for table `report_event_types` INSERT INTO `report_event_types` (`event_type_id`, `event_name`, `customer_login`) VALUES (1, 'catalog_product_view', 1), (2, 'sendfriend_product', 1), (3, 'catalog_product_compare_add_product', 1), (4, 'checkout_cart_add_product', 1), (5, 'wishlist_add_product', 1), (6, 'wishlist_share', 1);


Ron Polak says:
Sorry to inform you but your fix does not solve the problem of all product pages going to “Whoops, our bad…” 404 error pages. I’ve tried this with three different databases, each with the report_event_types table configured correctly. Using Magento CE 1.5.1.
Clinton says:
Beautiful it works perfectly!
Shakti says:
Worked great! Thanks!
Alex says:
Oh my gosh, thank you so much. That was taking me forever to figure out.