WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Move a WordPress2.0 up a directory level (18 posts)

  1. Harvey
    Member
    Posted 8 years ago #

    Hello everyone,

    I just recently ditched Moveable Type, and moved to WordPress 2.0.

    The installation went well, and eveything is working properly!

    Now, I have one more thing I would like to do.
    Currently my WP installation is in my http://www.japannewbie.com/blog/ subdirectory. I would like to move the entire WP installation up a level, so it is at http://www.japannewbie.com/ Where my old blog was.

    Is there a way I could move the current installation up a level without breaking things?

    Any advise would be helpful!

    - Harvey

  2. moshu
    Member
    Posted 8 years ago #

    Yes.
    1. Go admin > Options > General and change the two URIs to the new(future) address = the root.
    2. Do NOT try to see/open your blog in a browser!!!
    3. Move the files from the directory to the root.
    4. Now you can open your blog in a browser :)

  3. JoshuaStreet
    Member
    Posted 8 years ago #

    Won't that break permalinks?

    The only way I can think of is to copy/manually edit an .htaccess file into your DocumentRoot... uncertain, though?

  4. All permalinks generated by WordPress are dynamic. But links to the person's site located on another site will break.

    Easy to just do this though:

    RewriteEngine On
    RewriteRule ^blog/(.+)?$ http://www.japannewbie.com/$1 [QSA,L]

  5. Harvey
    Member
    Posted 8 years ago #

    How does one implement the code mentioned above?

  6. spencerp
    Member
    Posted 8 years ago #

    Go admin > Manage > Files

    And make sure your .htaccess file is writeable though. CHMOD that file like 666 or something. =) Hope this helps. Once you apply the following changes like Viper007Bond said, then click on the "Update File" button. =)

    spencerp

  7. Harvey
    Member
    Posted 8 years ago #

    Okay, so the steps would be...

    0.5. Edit .htaccess and include the 2 lines Viper007Bond has provided.
    1. Go admin > Options > General and change the two URIs to the new(future) address = the root.
    2. Do NOT try to see/open your blog in a browser!!!
    3. Move the files from the directory to the root.
    4. Now you can open your blog in a browser :)

    And that's all I would have to do, to drop my WP2.0 installion down one level. The links within my site will be all OK. Some links from outside may break (thats OK by me).

    Just clarifying. I'm scared to try this!

  8. spencerp
    Member
    Posted 8 years ago #

    Harvey, you should be just fine. =) That's what I had done with my main blog, and believe me, I'm always scared to do that..but that's normal lol. =) Anyway, just do what Moshu said first, then what Viper007Bond said, by editing the .htaccess file like I said. LOL!

    Okay, so the steps would be...

    1. Go admin > Options > General and change the two URIs to the new(future) address = the root.
    2. Do NOT try to see/open your blog in a browser!!!
    3. Move the files from the directory to the root.
    4. Now you can open your blog in a browser :)

    Edit the .htaccess like I said and include the 2 lines Viper007Bond has provided. =)

    Good luck, and I'm sure you'll be just fine.

    spencerp

  9. Harvey
    Member
    Posted 8 years ago #

    Okay, going to try right now!

  10. Harvey
    Member
    Posted 8 years ago #

    Hey guys, went thru it. But have trouble, seems links are broken~

    1. Go admin > Options > General and change the two URIs to the new(future) address = the root.

    Original:
    WordPress address (URI): http://www.japannewbie.com/blog
    Blog address (URI): http://www.japannewbie.com/blog

    New:
    http://www.japannewbie.com/
    http://www.japannewbie.com/

    UPDATE

    !!!
    Not Found
    The requested URL /wp-login.php was not found on this server.

    2. Do NOT try to see/open your blog in a browser!!!

    YES SIR

    3. Move the files from the directory to the root.

    cp -rf blog/* .

    OK.

    4. Now you can open your blog in a browser :)

    http://www.japannewbie.com -- OK.
    Admin Panel also OK.

    5. Edit .htaccess

    RewriteEngine On
    RewriteRule ^blog/(.+)?$ http://www.japannewbie.com/$1 [QSA,L]

    New .htaccess has following contents.

    DirectoryIndex index.html index.shtml index.htm home.html welcome.html index
    .php
    Deny From 80.36.223.107 80.58.39.174
    RewriteEngine On
    RewriteRule ^blog/(.+)?$ http://www.japannewbie.com/$1 [QSA,L]

    Conclusion.
    http://www.japannewbie.com loads my blog OK.
    Admin Panel works OK.

    However when I click on links in my blog... Like permalinks to posts...

    The requested URL /2006/01/06/hizamakura-china-version/ was not found on this server.

    Or the PAGES links in the tabs...

    Not Found
    The requested URL /older-docs/ was not found on this server.

    I get links not found etc.

    Any ideas on this? I guess I'm close... it seems that the htaccess bit isn't kicking in?

  11. Harvey
    Member
    Posted 8 years ago #

    I "rolled back" by resetting the config to the previous directory, and changing .htaccess back as well for now.

  12. moshu
    Member
    Posted 8 years ago #

    Since in your OP permalinks were not mentioned I didn't take them in consideration.
    Probably the only missing step in what you did was the Update of the permalinks settings.

  13. JoshuaStreet
    Member
    Posted 8 years ago #

    Viper007Bond, that's what I meant. Was mostly concerned for all those incoming trackbacks/pingbacks that would be broken... internal structures matter, IMO, far less. :-)

  14. Harvey
    Member
    Posted 8 years ago #

    Ahhh, to Update the Permalinks section, I just do Options > Permalinks > Update Permalink Structure? And it will run thru and update everything form me? Sounds like it's worth a shot!

  15. Harvey
    Member
    Posted 8 years ago #

    Thanks all! Fixed fixed.

  16. No worky. ;)

    http://www.japannewbie.com/blog/2006/01/06/hizamakura-china-version/

    That should redirect to the correct URL.

    Do you have the rewrite rules I gave you ABOVE the WordPress rules in your root .htaccess file?

  17. flammobammo
    Member
    Posted 8 years ago #

    Thanks everyone for this post, it made doing exactly the same thing work for me. I had two problems (one the same as Harvey, pointed out in the post above).

    1) http://tombammann.homedns.org/journal/***** was not updating to http://tombammann.homedns.org/*****

    Solution: I realised when I was updating .htaccess through wordpress, it did not save the changes! I resolved this by using a normal text editor.

    2) http://tombammann.homedns.org/journal/ displayed all the headers, sidebars, etc, but a big fat 404 for the content.

    Solution: A dodgy http://tombammann.homedns.org/journal/index.html to redirect to http://tombammann.homedns.org:

    index.html:

    <html>
    <head>
    <meta name="author" content="Tom Bammann">
    <meta http-equiv="refresh" content="0;url=http://tombammann.homedns.org">
    </head>
    </body>
    </html>

    Is there a more elegant solution for this second issue?

  18. flammobammo
    Member
    Posted 8 years ago #

    Sorry I just realised the more elegant solution to my second issue is as simple as adding a third line to the .htaccess file:

    RewriteEngine On
    RewriteRule ^journal/(.+)?$ http://tombammann.homedns.org/$1 [QSA,L]
    Redirect /journal http://tombammann.homedns.org

Topic Closed

This topic has been closed to new replies.

About this Topic