Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author KeyCDN

    (@keycdn)

    Make sure that your Site Address (URL) contains the subdirectory as well (Settings –> General).

    Thread Starter Luis Rodrigues

    (@goblindegook)

    Hi,

    I did, it doesn’t work. My directory structure is as follows:

    * / -> Frontend root (“home” setting points to this)
    * /content -> Uploads, themes and plugins are here
    * /wp -> WordPress core is here (“siteurl” must be set to this path)

    From the tests I ran, as long as the plugin targets siteurl for replacement, I’m unable to replace URLs in the /content directory (or any other directory outside of /wp). Patching the plugin to use “home” instead of “siteurl” fixes this.

    Plugin Author KeyCDN

    (@keycdn)

    This option fix your setup but might break others. We need to analyze first if this is a possible solution in general. Thanks for your feedback!

    I was just searching for a proper CDN plugin for wordpress and stumbled upon this thread as I regularly use the Bedrock development stack (https://roots.io/bedrock/). This stack uses the WordPress core as a Composer depency and thus keeps it in a subdirectory inside the docroot with a structure like this:

    Document root: /
    Wordpress Core: /wp
    Wordpress Content: /app

    The siteurl should never be used to access the wordpress root to reference the content dir, as it just points to the core files, but not necessarily to the root. Using home would not necessarily point to the name of the WordPress core dir, thus this would also not be a complete approach. I think the site_url has to be used in connection with the content dir, which can be accessed via the content_url() function separately.

    With this I just wanted to point out that having the wordpress core in a subdir is not an uncommon usecase indicated by over 2000 Github stars for Bedrock and I am totally looking forward to this being integrated into CDN enabler.

    Thanks a lot in advance!

    Eric

    Plugin Author KeyCDN

    (@keycdn)

    We made a few more tests and get_option(‘home’) seems to be the best solution for now. It works that way also perfect with Bedrock.

    Check out the new CDN Enabler release 1.0.2.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘URLs not replaced when WP is installed in a different directory’ is closed to new replies.