WordPress.org

Ready to get started?Download WordPress

Forums

Child Site 404s After Moving Files to Root (12 posts)

  1. winglimit
    Member
    Posted 2 years ago #

    Hey guys,

    I was trying to move a child site to the root directory (under htdocs, the folder that contains wp-admin, wp-content and wp-includes directories).
    I changed the blog's URL to domain.com and the location to / in the network admin settings and then tried to move the files:
    I made a back up of the root folder mentioned and then copied all of the directories and php/css files from the theme directory I wanted into the root.

    This didn't work (obviously?) and I had to revert the changes I made in the dashboard. I restored the files that were backed up, but now all of my child sites at domain.com/child are giving 404 errors.

    What got messed up exactly? Thanks in advance.

  2. You can't move a child site like that. All the sites use the same core WordPress files. Re-save your permalinks for your site to see if that cleans it up some.

  3. winglimit
    Member
    Posted 2 years ago #

    Thanks for your quick response. I re-saved the permalinks for my site, but that didn't help. Any more ideas?

  4. Can you still get into the network admin?

  5. winglimit
    Member
    Posted 2 years ago #

    Yes. Network admin and my "default" site works fine, it's just the child sites that give a 404.

  6. All of them?

    Did you move the .htaccess file back?

    Also

    I changed the blog's URL to domain.com and the location to / in the network admin settings and then tried to move the files:

    You changed that back, right?

  7. winglimit
    Member
    Posted 2 years ago #

    Yes, all of the child sites are 404'd.

    There was no .htaccess file in the directory, I'm running on Mac. .htaccess is elsewhere and didn't change.

    Yes, I changed the blog I modified back to domain.com/blog

  8. Mac is Unix ;)

    There should have been a .htaccess in the ... Hmm. You know, I think I need to ask this differently.

    Before you did all this, where was WordPress installed and what were the URLs?

  9. winglimit
    Member
    Posted 2 years ago #

    WordPress is installed in Applications/MAMP/htdocs

    MAMP is a program for automatically installing apache, mysql, php for Mac. Apache config files are in /MAMP/conf/apache and other config files are in similar subdirectories. The htdocs directory is the default directory for apache documents (index.html, etc.), so that won't change.

    There wasn't an htaccess file originally in the root directory when it worked, but I did some searching and found an (essentially) blank htaccess file in my hard drive's root containing only #BEGIN and #END tags for WordPress.

    Do I need to create an htaccess file now and put it into the root directory of the WordPress install even though it wasn't there before?

    I don't want to give out my actual URL, but the urls were like

    http://domain.com (default)
    http://domain.com/foo/
    http://domain.com/bar/

    and so on like that.

    (edit: showing hidden files is set to true in Finder, so it's not as if I couldn't see .htaccess, it literally wasn't there. By default Apache is set to ignore the htaccess file in OS X for some reason, so that may explain why it wasn't there)

  10. winglimit
    Member
    Posted 2 years ago #

    Ok, I got it working:

    I had to recreate the htaccess file and paste in the code from Network Admin -> Settings -> Network Setup

    which is curious because there was no htaccess file before, I'm even looking through my backups. Oh well.

    Now to try to move my child site up into root again...

  11. Now to try to move my child site up into root again...

    There's only ONE way to do that.

    If you ONLY want the child site in root, you have to install WP in root and then export from the old location into the new one.

  12. winglimit
    Member
    Posted 2 years ago #

    Gotcha. I'll give it a go.

    Thanks again for all of your help Ipstenu.

Topic Closed

This topic has been closed to new replies.

About this Topic