Can't change Magento base URL, stuck in cache

Can't change Magento base URL, stuck in cache

September 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Can't change Magento base URL, stuck in cache

Resolving Stuck Caching Issues in Magento 1.x

Hello fellow developers! Today we’re going to tackle an all-too-common issue that plagues us when working with legacy Magento installations - the dreaded caching problem after changing base URLs.

The Scenario: A Misconfigured Base URL

You’ve just installed a live site onto a development domain, eager to make some final tweaks before launch. You hop into the database and update those crucial web/unsecure/base_url and web/secure/base_url fields in the core_config_data table. But alas, a typo slips through the cracks, and your newly minted site starts serving up broken links.

The Culprit: Cache Files

The issue here is that Magento caches these base URL configurations at various levels - from file permissions to database entries. When you change the base URLs incorrectly, the cache doesn’t simply forget; it holds onto those bad values like a stubborn child refusing to share its toys.

First Things First: Delete All Cache Files

Your first line of defense is always a good old-fashioned cache sweep. Navigate to your Magento install’s var/cache directory and delete every file inside, no mercy!

rm -rf var/cache/*

Flush the Cache Storage

Next up, we need to flush the Magento cache storage itself. You can do this directly from the admin panel:

  1. Log into your admin dashboard.
  2. Click on System > Cache Management.
  3. Select all cache types by clicking the box at the top left of the grid.
  4. Click the Flush Cache Storage button.

The Magic Bullet: Reindexing

Now, here’s where things get interesting. Magento uses a concept called “reindexing” to update its data indexes after database changes - and this is exactly what we need to force our way out of this mess!

  1. In your admin panel, go to System > Index Management.
  2. Click the big Reindex All button at the top right of the page.

This process can take a while depending on the size of your catalog, so grab a coffee and let it do its thing.

The Final Tune-Up: Clear Browser Cache

Remember, it’s not just the Magento cache we need to worry about - our browsers can hold onto those old URL values too. Tell your users to clear their browser cache (and cache settings in any third-party tools like Google Analytics) for a fresh experience.

Conclusion

And there you have it - the ultimate guide to banishing those stubborn caching issues after changing Magento base URLs! Remember, with great power comes great responsibility: always double-check those URL updates before hitting save!

If you find yourself regularly dealing with these types of issues in your e-commerce projects, I highly recommend checking out our post on Best Practices for Magento Performance Optimization to streamline your development workflow.

Keep coding, and until next time!

Magento 1 Cache Database Security

Our network