• Resolved magicke

    (@magicke)


    We followed the procedure for setting up the CDN and enabling it for use on our site, and are happy to report that the plugin worked from the get-go.

    Recently though, while the DreamHost support people were working out a hosting issue with us, they pointed out that the plugin was setting the old URL for the media files.

    URL being set by plugin is — https://adatel-cdn.objects-us-west-1.dream.io

    Accelerated DreamSpeed CDN version of this bucket: http://adatel-cdn.objects.cdn.dream.io/

    We’re not using the CDN Alias setting, since the site is set up to use HTTPs.

    Our question —

    Is there a way to force the plugin to use the accelerated URL instead of the actual bucket URL?

    Any help in this matter will be much appreciated!

Viewing 8 replies - 16 through 23 (of 23 total)
  • Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I know it works for you. It doesn’t work for more people.

    There are a handful of people who seem to be okay with it… I’m thinking I’ll have to put in an override for you, with a bunch of ‘If this breaks your site, I warned you!’ notices. The problem is if it DOES break, it’s hard to fix :/

    How exactly is it changing the URLs? Could a simple search and replace for every image on the database fix this for me or is it using a filter to swap the urls?

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    It replaces it on upload. It runs through an annoying complicated series of checks, in order of priority. In the middle, it checks if you have a custom CDN and are NOT SSL, and only then will allow the change. So right now, you’d have to manually change it all every time, or I’ll have to think up a work around for the handful of people like you.

    I do want to restrict this because I had far more complaints about SSL breaking than I’ve had about being annoyed by this change. Bit of a rock and a hard place there!

    You know, if I’m willing to do a search/replace on my whole database and I also tend to s3cmd sync once in a while, I probably ought to just do it manually and disable the plugin I’m thinking. Easier for you and I can just put the search/replace in a shell script that runs every time I update.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    If you’re command-line zippy, then you can two-step it. Or one step it.

    Have a script that does this:

    1) s3cmd sync
    2) wp search-replace 'yourdomain.com/wp-content/uploads/' 'adatel-cdn.objects.cdn.dream.io/wp-content/uploads/

    Then put the script in a morning cron-job on the server. It won’t be as on-demand, but it would work.

    We talked about this once before, but I use Git to update my site and it runs a hook (shell script) that upon completion of the git process changes some things in the database. I’d just add a line to search/replace everything.

    Is that wp search-replace and actual command?

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The command is missing an end apostrophe but this is how it works:

    wp search-replace 'OLDURL' 'NEWURL'

    So if your default URL is yourdomain.com and you only want to change the URLs for images then it’s this:

    wp search-replace 'yourdomain.com/wp-content/uploads/' 'yourcdn.com/wp-content/uploads/'

    You have to be as specific as possible otherwise you could replace things you didn’t mean to.

    I will consider that, it seems easier than any sed or mysql query I could run.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘URL being set by plugin not using accelerated version of URL’ is closed to new replies.