WP Super Cache
CDN support breaks setting WP_SITEURL in wp-config (4 posts)

  1. werkshy
    Posted 5 years ago #

    I have these line in my wp-config.php to dynamically set the blog URL based on the http request.

    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] );
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] );

    The purpose of this is to enable a staging server... whatever URL you use to connect to the site, all the links to stylesheets etc will be to the same server.

    A recent update to WP Super Cache broke this. It's the CDN functionality. The CDN assumes that it knows your site URL. Also it is turned on by default.

    Setting the CDN include_dirs to a nonsense value is a good workaround. I'm not sure what the best fix would be... Not enabling CDN support by default would be a good start, and having a checkbox to enable it in the settings.


  2. Donncha O Caoimh
    Plugin Author

    Posted 5 years ago #

    The next version will have an on/off switch but why not just set the cdn URL to the same one you've set in the config file?

  3. werkshy
    Posted 5 years ago #

    Can you do that in the UI? I think the default should match the rest of WP and use $WP_SITEURL.

    Putting in a non-existant directory to include_dirs is a fine workaround which basically disables it.

  4. Donncha O Caoimh
    Plugin Author

    Posted 5 years ago #

    Yeah, it has an on/off switch in the UI now. Try the development version if you want to see.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic