WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. werkshy
    Member
    Posted 4 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.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 4 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
    Member
    Posted 4 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
    Member
    Plugin Author

    Posted 4 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

About this Topic