Domain Mapping Breaks CDN Redirects?

Hi,

We are noticing an apparent issue with the Domain Mapping plugin breaking CDN redirects.

We have set up a few test sites on a 3.0.1 multisite network. We use the OSSDL CDN Off-Linker plugin to create the new URLs for CDN items.

So, for example, the hostname for images ends up being cdn.mydomain.com, rather than mydomain.com.

When we add this plugin to the mix, the URLs are not rewritten by the plugin any more. So, for example, you never see cdn.mydomain.com and more...just the original hostname.

However, this problem does not seem to happen when using Donncha's domain mapping plugin.

Any ideas?

Thanks,

Mark

  • wpcdn
    • Syntax Hero

    Thank you!

    BTW, you should be able to test this even without CDN set up. If you load a CDN hostname into the plugin (e.g., cdn.myhost.com), you can still see whether or not the redirected URLs are applied or not.

    Or, if you need a CDN test bed to troubleshoot this issue, let me know.

    Mark

  • Ulrich
    • The Crimson Coder

    That cdn plugin looks for the original domain url in the site html output and replace it with the cdn domain.
    Since the domain mapping plugin replaces all references to the original domain url by the mapped one (something Donncha's domain mapping plugin doesn't do), the plugin cannot rewrite these urls.

    There are two possible solutions:
    1- switch to a cdn plugin which uses the recommended WordPress api functions to rewrite urls instead of a php output buffer as this plugin does.
    2- if you want to continue using this plugin, modify the plugin code so that it recognizes the mapped domains.

    If you want to go with solution 2, I will be able to help you.

  • wpcdn
    • Syntax Hero

    Thank you for the reply.

    I wouldn't object to using Donncha's plugin, however I assumed that yours is better since it was apparently created to be a better alternative to his. Can you let me know the advantages of your domain mapping plugin over Donncha's or others?

    If yours has significant advantages, I would be interested in solution 2 as long as it wouldn't add much overhead which would slow down CDN redirects (and I doubt it would). So, if we do end up choosing solution 2, we would appreciate your help.

    I think solution 1 will be the easiest, however I'd like to learn more about the advantages of your domain mapping plugin first.

    Thanks,

    Mark

  • wpcdn
    • Syntax Hero

    Followup: I mis-read your message and thought you were suggesting to use a different domain mapping plugin...now I see that you were recommending a different CDN plugin.

    We'd like to stay with this CDN plugin if possible, for a few reasons. We will consider others, but I'm not sure if they'd use the same approach.

    So I guess the biggest question is still which domain mapping plugin to use. I look forward to hearing the advantages of yours. Meanwhile, I will test with other CDN plugins. But it might be harder to implement others in the way we hope to implement this one. (Long story.)

    Thanks,

    Mark

  • Ulrich
    • The Crimson Coder

    A non-exhaustive list of features that our Domain Mapping plugin has and Donncha's one doesn't:
    - works on subdomains and subdirectories
    - handles cross domain cookie syncing
    - integrates fully with our other plugins: Supporter, etc.
    - allows for multiple domain mapping to the one blog
    - replaces all references to the original domain url in the html output

  • James Farmer
    • CEO (of WPMU DEV, honest)

    I might also add that:

    - We guarantee ours will work
    - We guarantee to support and develop it based on the needs of our members
    - Oh, and of course it is developed to work with everything else we offer

    Now, if had a website that I cared about, would I go and rely on one persons altruism or choose the WPMU DEV approach...

  • wpcdn
    • Syntax Hero

    Hi James,

    Good points. Our issue is that we've done a lot of work around that particular CDN plugin. (Long, long story.) If we can't find an alternative quickly, we might need to stick with it. But we are looking at alternatives or the tweak recommended by Ulrich.

    Thanks!

    Mark

  • wpcdn
    • Syntax Hero

    Followup: We are using WP Super Cache. I know that Donncha's domain mapping plugin is designed to work hand-in-hand with that, for example there is a switch in Super Cache to turn on support for the domain mapping plugin.

    Would there be any issues using your domain mapping plugin with WP Super Cache?

    Thanks,

    Mark

  • wpcdn
    • Syntax Hero

    It would involve modifying the first two lines of the plugin to replace get_option('siteurl') by the mapped domain.

    Would you be willing to show exactly how this would need to be modified to work with your domain mapping plugin? I think the coding of this is beyond me.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.