The prior solutions to this problem did not work for me.  The FWR solution works ok for categories but does not return to the correct point if you use another filter, like manufacturer, occasion or price range.  The earlier solution of checking for the product_info page and deducting 3 appealed to me but I found that it failed when the customer enters the website directly into the product page even if they then go to the home page after (due to the way the navigation uses array splicing).

The solution that worked for me was to combine the product_info page check described earlier with another change to the navigation history class, which forces the first entry in navigation history to be the home page, regardless of which page is actually the entry point.  This allows the home page to always be found by the navigation logic when there is not a more appropriate list page to show.

If you want to apply this change, the following code is required to be added to catalog/includes/classes/navigation_history.php.

Replace:

    function add_current_page() {
      global $PHP_SELF, $_GET, $_POST, $request_type, $cPath;

      $set = 'true';

With:

    function add_current_page() {
      global $PHP_SELF, $_GET, $_POST, $request_type, $cPath;

      if (sizeof($this->path) == 0) {
        $this->path[] = array('page' => FILENAME_DEFAULT,
                              'mode' => $request_type,
                              'get' => array(),
                              'post' => array());
      }

      $set = 'true';

This change should not cause conflicts with any other method used to handle the continue shopping logic, but as always - make a backup first! 