When setting up Magento to work with a CDN via native support, you need to be careful that you enter the correct CDN URL in proper fields. In case you accidentally insert the wrong URL, URLs without http(s):// or the correct URL in a wrong section (HTTPS URL into an HTTP field), you can easily break your website since Magento will not be able to populate pages using the wrong CDN URL.

As long as you did not choose the option to apply the CDN URL to admin area files, this can be easily fixed in the Magento control panel. However in most cases the CDL URL is applied to the admin area, and so the mistake cannot be fixed inside Magento.

How To Resolve:

This can only be fixed by going into the Magento database and making manual changes in the table → “core_config_data”:

  1. PhpMyAdmin:


    Ask your web-hosting provider if they offer this utility.

    1. Log into PhpMyAdmin.
    2. Select your database from left side menu.
    3. Click the “Search” tab on the top of the page.
    4. In search phrase type the wrong URL you added, select “core_config_data” from the “Inside tables” menu and click “Go.”
    5. After you get search result just replace wrong url(s) with correct and after you hit “enter” changes will be saved

    Unsecure Section Example:

    • Wrong URL
      web/unsecure/base_url          http://domain.com/
      web/unsecure/base_link_url     {{unsecure_base_url}}
      web/unsecure/base_skin_url     http://wrong.url.netdna-cdn.com/skin/
      web/unsecure/base_media_url    http://wrong.url.netdna-cdn.com/media/
      web/unsecure/base_js_url       http://wrong.url.netdna-cdn.com/js/
    • Correct URL
      web/unsecure/base_url          http://domain.com/
      web/unsecure/base_link_url     {{unsecure_base_url}}
      web/unsecure/base_skin_url     http://foo.bar.netdna-cdn.com/skin/
      web/unsecure/base_media_url    http://foo.bar.netdna-cdn.com/media/
      web/unsecure/base_js_url       http://foo.bar.netdna-cdn.com/js/

    Secure Section Example:

    • Wrong URL
      web/secure/base_url            https://domain.com/
      web/secure/base_link_url       {{secure_base_url}}
      web/secure/base_skin_url       https://wrong.url.netdna-cdn.com/skin/
      web/secure/base_media_url      https://wrong.url.netdna-cdn.com/media/
      web/secure/base_js_url         https://wrong.url.netdna-cdn.com/js/
    • Corrected
      web/secure/base_url            https://domain.com/
      web/secure/base_link_url       {{secure_base_url}}
      web/secure/base_skin_url       https://foo.bar.netdna-cdn.com/skin/
      web/secure/base_media_url      https://foo.bar.netdna-cdn.com/media/
      web/secure/base_js_url         https://foo.bar.netdna-cdn.com/js/

    Reload your Magento website and it should be now loading properly.

  2. SSH/terminal access:

    Important Note

    Be sure to ask your web-hosting provider for your specific MySQL database account login details, or check your Magento configuration file.

    1. Create a backup of your database: mysqldump -u [user] -h [server] -p [db_name] > [backup_file].sql
    2. Log into your database server: mysql -u [user] -h [server] -p [db_name]
    3. Update the wrong URL value with correct URL: update core_config_data set value = ‘http://foo.bar.netdna-cdn.com’ where value = ‘wrong.url.netdna-cdn.com’ ← depending on whether you need to alter the HTTPS or HTTP value.
    4. Reload your Magento website and it should be now loading properly.