I have a site that displays several SVG maps and when a user clicks on hotspots an iframe populates with data pulled from various JSON files depending on the map displayed.
Recently, we've been given a directive to create a new domain name, and transition away from the old domain (yep, a gov't project). Below is the iframe template code for the map that is broken, and simply displays "The requested content cannot be loaded. Please try again later."
It is only broken when accessed from the new domain, which is defined as domain alias currently, so this shouldn't be related to cross-domain calling or CORS, right? Again, only 1 out of 6 SVG maps is having this issue.
<?php
/*
Template Name: COUNTY: Iframe Fancybox
*/
if(!$_SERVER['HTTP_X_FANCYBOX']) {
$url = str_replace('info','geo',$_SERVER['REQUEST_URI']); _err("iframe: $url");
header("Location: $url");
}
$i = $_GET['i'];
$bubbles = json_decode(file_get_contents('wp-content/plugins/svg_map/data/2016/all-bubbles.json'),true);
$region = $bubbles['chart_data'][0]['counties'][$i];
?>
My initial thought was to hardcode the new domain into the file_get_contents parameter, but that didn't work. To be sure, I hardcoded both versions of the domain. I feel like I'm missing something obvious. I tried searching here and on google, but had a difficult time articulating the question, so I wasn't getting any good results. Any suggestions would be appreciated, and I apologize if the question is lacking the actual website links to look at.