Support » Plugin: CDN Enabler - WordPress CDN Plugin » Inline JavaScript file strings trigger CDN replacement

  • Resolved elvenspellmaker

    (@elvenspellmaker)


    Hi there,

    We have an inline minified script that has a section like the following:
    e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";

    If we enable relative paths redirect then we get the following:
    e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"https://subdomain.oursite.com/analytics.min.js";

    Our settings look like the following:

    URL: https://subdomain.oursite.com
    Include: wp-content,wp-includes
    Exclusions: .php
    Relative Path: Ticked
    Https: Ticked

    I would assume that with relative paths on it’d still only capture things which had the includes before it?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can you try putting that file inside its own folder (e.g. analytics/analytics.min.js) and then add “analytics” to your list of exclusions.

    As this is an external link I cannot affect where this URL is coming from, it’s a script that seems to get an external link, we have no control over cdn.segment.com.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Inline JavaScript file strings trigger CDN replacement’ is closed to new replies.