WordPress.org

Ready to get started?Download WordPress

Forums

When changing my theme in a subdirectory it is also affecting the root directory (6 posts)

  1. cyberlicious
    Member
    Posted 1 year ago #

    Hey!

    I'm having complications copying WordPress from a root directory into our /new directory so I can work on the new site without affecting the current site on root.

    Steps:

    1. Copied all the files from root to /new
    2. Tried logging into /new/wp-login.php to get to Settings>General and change the URLs, but it didn't work. Received an error in the browser.
    3. Found information on editing /new/wp-config.php by adding the two lines:

    /** WordPress Move into /new Directory */
    define ('WP_HOME','http://www.example.com/new');
    define ('WP_SITEURL','http://www.example.com/new');

    4. Ability to login from the /new directory is now successful.
    5. Went to change the Theme, but it also affects the root them.
    6. Edited .htaccess by adding /new:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /new
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /new/index.php [L]
    </IfModule>
    # END WordPress

    7. Tried adding /new to /new/index.php, but this returned a fatal error:

    /** Loads the WordPress Environment and Template */
    require('./new/wp-blog-header.php');

    8. Stopped fooling around as I may simply have an issue with the database itself, and should probably create a new one. Just not sure what to do or where to go from here.

    Can someone please help? I cannot seem to find the answers in the codex or I simply all over the place requiring some focus on the steps that I am taking. Thanks in advance to you super helpers! ;-)

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Have you reviewed Moving_WordPress?

  3. cyberlicious
    Member
    Posted 1 year ago #

    It would seem we are almost there, just need to figure out how to make changes in /new without affecting the root. I just need to follow the instructions in Moving_WordPress to the T, huh?

    Sorry, I'm a dive in and break things to learn, kind of personality. Extremely hands on. I'll start with what you suggest and focus on following all the directions in order. Thanks!

  4. cyberlicious
    Member
    Posted 1 year ago #

    @esmi, I have reviewed the instructions, but I am still confused. Let's say I completely start over...

    I create /new (or at least it's empty) then I go to /wp-login.php to login. I then go to the General Settings to change the WordPress and Site URLs. But doesn't this change the root site? This is what I do not want to do.

    I want to create an environment in /new that is separate from root. Then when I'm done redesigning in /new, I want to take it and make it root. Why am I confused?

    Should I just create a copy of the database, reflect this in /new/wp-config.php then replace the URLs accordingly in the copied database? Once I am done redesigning, move the files back to root and update the database to reflect the root URLs?

    Thanks!

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    You need to be following this section.

  6. cyberlicious
    Member
    Posted 1 year ago #

    I think that's why this is confusing and WordPress should better organize their codex for learners like myself. You start reading instructions then at the end it says "but if you need to do this" or "you may want to do this instead". Maybe this is why there is those For Dummies books. Thanks for your quick response esmi!

Topic Closed

This topic has been closed to new replies.

About this Topic