Humm, OK. Probably the reason why it is not installing is due to the web app manifest. If you look at the source of https://ditamvncmg2gy.cloudfront.net/ you’ll see:
<link rel="manifest" >
Most likely for that to work, the https://www.vaccinesafety.edu
should be stripped from the URL in the same way as you have done for the other URLs on the page. The URL for the manifest is obtained via a call to rest_url()
so you can use the rest_url
filter to strip out the host, using something like this:
add_filter(
'rest_url',
static function ( $url, $path ) {
if ( '/web-app-manifest' === $path ) {
$url = wp_parse_url( $url, PHP_URL_PATH );
}
return $url;
},
10,
2
);
Then, if you look at the actual contents of the web app manifest, you’ll see the start_url
is as follows:
"start_url":"https:\/\/www.vaccinesafety.edu\/"
You’ll also likely need to rewrite that to be the URL for the CloudFront domain, using whatever logic you have in place to do so. For example:
add_filter(
'web_app_manifest',
static function ( $manifest ) {
if ( is_serving_from_cloudfront() ) {
$manifest['start_url'] = 'https://ditamvncmg2gy.cloudfront.net/';
}
return $manifest;
}
);
Naturally you’ll need to replace is_serving_from_cloudfront()
with your logic.
Hope this helps!