This article will walk a user through how to setup the StackPath CDN with Magento 1.x without using a 3rd party plugin.
This tutorial assumes a StackPath Site is created.
Setting up a CDN using Magento’s Native Support:
- Log into the administrative control panel of your website.
- Go to System → Configuration
- Under General select Web option.
- Go to the unsecure settings tab.
- Configure the unsecure section as follows:
- Set the Base URL of your website so that your website domain is in the following format: http://www.mywebsite.com.
- Base link URL: leave as default: {{unsecure_base_url}}.
- Base Skin URL: http://something.stackpathcdn.com/skin/
- Base Media URL: http://something.stackpathcdn.com/media/
- Base JavaScript URL: http://something.stackpathcdn.com/js/
Do not forget to replace “site.company-stackpathdns.com” with your actual Edge Address from your StackPath Site.
Setting Up The StackPath CDN with HTTPS
In case your website is using secure connections you could use your Edge Address from your StackPath Site in your Secure Settings tab as well, you should use only https in front of it is as shown below:
- Go to the Secure Settings tab.
- Configure the Secure section options as follows:
- Base link URL: leave as default: {{secure_base_url}}.
- Base Skin URL: https://something.stackpathcdn.com/skin/
- Base Media URL: https://something.stackpathcdn.com/media/
- Base JavaScript URL: https://something.stackpathcdn.com/js/
Using the https protocol is a necessity in the Secure tab in order for links to be loaded properly on pages that use secure connections.
Please note the warning inside this tab section: “When using CDN, in some cases JavaScript may not run properly if the CDN is not in your subdomain”. If you experience any issues, our support staff can assist you through this.
Congratulations you are officially using The StackPath CDN on your website.