Cloudflare – CPanel – Parallelize downloads across hostnames

I have a wordpress website which is using Cloudflare. So basically, I created a Cloudflare account and setup everything including changing the nameservers so that the domain goes through Cloudflare first.

Let’s say my domain is

Now I have a sub-domain called in which I need to parallelize downloads across hostnames.

All the necessary wordpress code (shown below) is already in place in functions.php.

function parallelize_hostnames($url, $id) {
     $hostname = par_get_hostname($url);
     $url =  str_replace(parse_url(get_bloginfo('url'), PHP_URL_HOST), $hostname, $url);
     return $url;

function par_get_hostname($name) {
    $subdomains = array('','', ';
    $host = abs(crc32(basename($name)) % count($subdomains));
    $hostname = $subdomains[$host];
    return $hostname;

add_filter('wp_get_attachment_url', 'parallelize_hostnames', 10, 2);

So after following a tutorial, I set 3 A records in Cloudflare called, and to point to my server’s IP address.

Then in my CPanel I set 3 CNAME records with the same 3 names all pointing to

Waited more than a day and now when I visit, or, I always get a hostgator 404 page.

What am I doing wrong please? Does this setup make sense?

The wordpress code is working since I could verify this in the browser console. However, all media requests via temp1, temp2 and temp3 are giving a NOT FOUND error.

Read more here: Cloudflare – CPanel – Parallelize downloads across hostnames

Leave a Reply

Your email address will not be published. Required fields are marked *