• Hi – running multi-site and trying to figure out how to use the following to define a completely different server location for my plugins and other wp-content storage.

    I’m trying to use wp-config to do this but can’t seem to make it work. Using the following:

    define( ‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content’ );
    define( ‘WP_CONTENT_URL’, ‘https://example/blog/wp-content’);
    define( ‘WP_PLUGIN_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content/plugins’ );
    define( ‘WP_PLUGIN_URL’, ‘https://example/blog/wp-content/plugins’);

    If my main site is being hosted from https://www.domain.com, I want to have the wp-content and plugins served from a different server located at https://content.domain.com.

    I’ve tried putting in the server’s DOCUMENT_ROOT for content.domain.com which is quite different than the main site and so far, although WordPress loads – it can’t find the new locations. Since it is a different server in a different location, do I need to somehow also specify the fully qualified domain within the DOCUMENT_ROOT?

    I’m doing this because the front-end server is designed to have limited storage – and is attempting to connect with a different server (content.domain.com) that is purpose built to house everything.

    Thanks for your help!

Viewing 1 replies (of 1 total)
  • My guess is this can’t be done. WordPress uses PHP’s include etc. to process other PHP files. Although you can use URLs to specify included files, if you do that the included files don’t inherit the parent file’s variable scope in the way WordPress expects.

    If your “front-end” server’s storage is so limited, why not just use the other server to run the entire site?

    Alternatively, you might be able to find a way to map part of the the “front-end” server’s file system to the “content” server’s file system so that WordPress does not have to use HTTP to include the files.

Viewing 1 replies (of 1 total)
  • The topic ‘Serving wp-content and plugins from a different base server location’ is closed to new replies.