When removing an item from the cart, Magento redirects to store home page instead of /checkout/cart/

When removing an item from the cart, Magento redirects to store home page instead of /checkout/cart/

July 21, 2026 · Illustrated author avatarBy Stefan Bogdanescu
When removing an item from the cart, Magento redirects to store home page instead of /checkout/cart/

Debugging Cart Redirection Issues in Magento 1.4.2

You’re not alone in facing this common issue with Magento’s cart redirection after deleting items. The default behavior in versions 1.4.x is to redirect back to the home page instead of remaining on the checkout/cart page, which can be quite frustrating for users.

Understanding the Redirect Behavior

In Magento 1.4.2, when you delete an item from the cart, the system fires the controller_action_postdispatch_checkout_cart_index_delete event. The default observer attached to this event is responsible for setting the redirect path after deletion.

The core file handling this logic is located at app/code/core/Mage/Checkout/controllers/CartController.php. Inside the deleteAction method, you’ll find:

$redirectUrl = $this->getRedirectUrl($isAjax);
$this->_redirect($redirectUrl);

By default, $redirectUrl is set to the base URL of the store (the home page). This behavior is defined in app/code/core/Mage/Core/Controller/Varien/Action.php:

public function getRedirectUrl($keepFormData = false)
{
    return $this->getResponse()->getHttpResponseCode() == 302 ? $this->_redirectUrl : $this->getBaseUrl();
}

Common Causes for the Redirection Issue

  1. Customizations in the Old Cart: If your old cart running Magento 1.1.6 was heavily modified, some core files might have been altered to change this redirection behavior.

  2. Website Configuration Settings: Check if there are any differences in the configuration settings between the two websites or store views you mentioned.

  3. Rewrite Rules Conflicts: If you’ve implemented custom rewrite rules for your second store at https://www.thestore.com/second-store/index.php/, these could potentially interfere with Magento’s default redirection logic.

Potential Solutions and Debugging Steps

  1. Check Your Local.xml Configuration: Ensure there are no changes in the <global> or <checkout> sections of your local.xml file that might affect cart redirection.
<config>
  <global>
    <checkout>
      <cart>
        <remove_url_after_delete>1</remove_url_after_delete>  <!-- Set to 0 if you want to stay on the checkout/cart page after deletion -->
      </cart>
    </checkout>
  </global>
</config>
  1. Disable Custom Modules: If you have any custom modules installed, temporarily disable them and see if the issue persists.

  2. Check .htaccess Files: Ensure that your .htaccess files in both stores are identical and do not contain any conflicting rewrite rules.

  3. Investigate Core File Modifications: Use a version control system like Git to compare the core files of your old and new installations. Look for differences in Mage_Checkout controllers or Mage_Core Action classes.

  4. Enable Developer Mode: Switch your Magento instance to developer mode by setting dev->area to ‘frontend’ in your index.php file. This will enable debug logging, which might provide more insights into the redirection issue.

Conclusion

Debugging cart redirection issues often involves a combination of checking configuration files, comparing core file changes, and investigating customizations in third-party modules or themes. Remember that Magento 1.4.2 is quite old at this point, so some modern best practices like using separate index.php files for each store view may introduce unexpected behaviors.

If you’re looking to upgrade your cart system, consider migrating to a more recent version of Magento (2.x) or exploring alternative e-commerce platforms that offer better performance and more stable development environments. You can find helpful resources on migration strategies at Laravel Company’s Magento Development Guide.

Magento 1 Checkout Security Extensions

Our network