From local server to live web server, links not working [Magento]

From local server to live web server, links not working [Magento]

August 25, 2026 · Illustrated author avatarBy Stefan Bogdanescu
From local server to live web server, links not working [Magento]

Migrating your local Magento installation to a live server can be a complex process if not handled carefully. In this article, we will address the common issue of broken links after migration.

Understanding the Base URL Configuration in Magento

Magento uses the base URL to generate absolute URLs for all links on your site. This includes product pages, category pages, and even internal admin URLs. The base URL is stored in the database under the core_config_data table at the path web/unsecure/base_url.

In your case, you have correctly set this value to http://www.mysite.com/, which matches your live domain.

The first step in troubleshooting your issue is to ensure that all links on your site are absolute URLs. Magento generates these automatically by default, but sometimes relative or incorrectly formatted links can slip through during development or migration.

To check for any problematic links:

  1. Browse your live site and click on a few category or product links.
  2. Right-click on the link URL in the browser address bar and select “Copy” or “Inspect”.
  3. Paste the link into a text editor like Notepad++ or Sublime Text and check for any relative paths (i.e., starting with // or /).

If you find any relative links, they will need to be updated using Magento’s absolute URL generation functions.

Reviewing .htaccess Redirects

The .htaccess file is crucial for handling URL rewriting in Magento. It contains the base rules that allow your site to function correctly after migration.

Ensure that your live server has the same .htaccess configuration as your local environment. This includes any custom redirects or URL rewrite rules you may have implemented.

Verifying File Permissions and Ownership

In some cases, broken links can occur due to incorrect file permissions or ownership on the live server. Magento requires specific permission levels for certain files and directories to function correctly.

The key directories to check are:

  • media/
  • var/cache/
  • var/session/
  • app/etc/

Each of these should have at least 644 permissions (read-write for all users).

Additionally, the owner of these files should match the web server user. On most systems, this is typically www-data or apache.

Clearing Magento Cache

After updating any configuration changes in the database or .htaccess file, it’s essential to clear the Magento cache. This ensures that your site reads the updated information correctly.

You can do this by navigating to System > Cache Management in the admin panel and selecting “Flush Magento Cache”. Alternatively, you can manually delete the contents of the var/cache/ directory via FTP or SFTP.

Conclusion

In most cases, broken links after a Magento migration are caused by incorrect base URL configuration or relative links. Always double-check your database settings and inspect any suspect URLs for formatting issues.

Remember that Magento requires specific file permissions and ownership to function correctly. Be sure to review these on your live server, especially if you’ve migrated from a different environment.

If the issue persists after checking all of the above points, it’s worth reaching out to Magento support or consulting with an experienced developer.

At Laravel Company, we specialize in helping businesses migrate and optimize their Magento installations for peak performance. Contact us today to discuss your specific needs and ensure a smooth transition to your live server.

Catalog Database Admin Configuration

Our network