WordPress.org

Ready to get started?Download WordPress

Forums

Moving wp-content directory on 1and1 hosting (4 posts)

  1. Steven Fewings
    Member
    Posted 2 years ago #

    Hi,

    I'm having some difficulties getting the my plugins to work when i move the wp-content folder to it's own directory. The directory structure I'm using is:

    .htaccess
    index.php
    wp-content (themes, plugins, uploads
    wp (contains wordpress install)
    wp-config.php

    I've defined the new local of the wp-content folder in the wp-config file as follows:
    define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' );
    define( 'WP_CONTENT_URL', 'http://lab.silverchairdev.co.uk/wp-content');
    define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins' );
    define( 'WP_PLUGIN_URL', 'http://lab.silverchairdev.co.uk/wp-content/plugins');
    define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins' );

    This all works fine on my local machine but when I move it to our 1and1 staging server the plugins stop working correctly. An example of this is on the yoast SEO plugin where it can no longer find it's icon or javascript files needed to make it run correctly. The file path to the plugins is icon is showing as http://lab.silverchairdev.co.uk/wp-content/plugins/homepages/44/d408549800/htdocs/silverchair/lab/wp/wp-content/plugins/wordpress-seo/images/yoast-icon.png when it should be http://lab.silverchairdev.co.uk/wp-content/plugins/wordpress-seo/images/yoast-icon.png

    Any help would be much appreciated.

    Thanks

    Steve

  2. Natasha
    Member
    Posted 2 years ago #

    Hi Steve,

    I have a very similar problem. Have you had any luck fixing it?

  3. Steven Fewings
    Member
    Posted 2 years ago #

    Hi Kallsey,

    The 1and1 servers don't seem to like the use of $_SERVER['DOCUMENT_ROOT'] so you need to put the directory path in your self. I used the following, which seemed to fix the problem. I presume that 'homepages/44/d408549800' is unique to each account so you will need to change that.

    define( 'WP_CONTENT_DIR', '/homepages/44/d408549800/htdocs/yourdirectory/wp-content' );

    define( 'WP_CONTENT_URL', '/wp-content');

    Hope that helps.

    Steve

  4. Natasha
    Member
    Posted 2 years ago #

    Steve,

    You are a saint! That did it!

Topic Closed

This topic has been closed to new replies.

About this Topic