- This is by no means a simple process. You will need a good understanding of how website hosting works, including logging into your hosting account, configuring domain names, configuring the WordPress wp-config.php file and applying bulk changes to the database using phpMyAdmin.
- This can only work if you run your website from a www. address, e.g. https://www.itsupportguides.com — this allows you to separate the ‘cookie’ domain (www) and the cookieless domain (static).
- This process, specifically step 3, will involve bulk changes to your content using database tools. I highly suggest you create a backup of your WordPress database before continuing. Using phpMyAdmin this can be done using the ‘export’ option.
- Depending on the websites hosting environment it can take up to 24 hours for the new static sub-domain to start working. Typically it takes 5-15 minutes, but propagation of DNS changes can take up to 24 hours.
Step 1: Create a subdomain using cPanel or any other panel for the static content
You will now be able to open static.domainname.com and see a blank page
IMPORTANT: Test to make sure that your static address is loading – e.g. https://static.domainname.com (or https if you use it). DO NOT PROGRESS UNTIL THIS LOADS — you will see a blank page when it is working correctly.
Note: it takes time for new subdomains to be available. Typically it takes about 10 minutes, but can take up to 24 hours depending on how you access the Internet. If you’re having problems accessing the subdomain, try from another Internet connection or using an online tool such as Pingdom Tools.
Step 2: Configure WordPress
Using your preferred method, for example FTP or through the cPanel, navigate to the root directory of your WordPress installation and edit wp-config.php
Add the following lines to the top of the file, below the <?php
Replace domainname with the domain name for your website
define("WP_CONTENT_URL", "https://static.domainname.com");
define("COOKIE_DOMAIN", "www.domainname.com");
define("WP_PLUGIN_URL", "https://static.domainname.com/plugins");