In this article, we are going to change the base URLs of a Magento 1 website, using the swiss army knife for Magento developers, sysadmins and devops i.e. n98-magerun.
Base URLs can be also changed from the Magento Site backend as well as from the Database using phpMyadmin or Mysql REPL too.
To serve, content from CDN, we need another domain/sub-domain (lets' say cdn.magehost.cloud) for which CDN is enabled (i.e. cdn.magehost.cloud is proxied to serve content from the server running the Magento 1 site, and this content will be cached by the proxy server (CDN))
Magento 1 stores all the crucial configuration in the Database in core_config_data table.
To setup CDN, first make sure correct CORS headers are setup on the server.
In our cPanel Server Stack, to add a domain/sub-domain, perform the following steps:
- Login to the cPanel account and search for "Aliases" and click on it.
- To add a domain alias, enter the domain name in the text box.
- Click Add Domain.
- No redirections are required in this case, so click on "Disable Redirection" from the "Manage Redirection" option for the domain alias.
In cPanel Server Stack, there is already n98-magerun present on the server, and can be accessed with the command "magento-cli", yet n98-magerun can be easily downloaded via. (wget
https://files.magerun.net/n98-magerun.phar)
Note : Use n98-magerun/magento-cli from the document root of the Magento site, as the cPanel account user.
To run a magento site on a domain/sub-domain we need to set the required base URLs in the core_config_data table.
Run following command to get the list of already set base URLs