WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Moving WordPress from /blog/ to /wordpress/ (12 posts)

  1. ssor
    Member
    Posted 6 years ago #

    Hello,

    I wish to 'move' (or rename?) the folder that my current WordPress installation is held in which is /blog/ to /wordpress/ and update the Permalink structure to something pretty from the ugly one.

    I was just wondering if anyone knew of any documentation on this, or tutorials? Is there anything I need to take into consideration? What will happen to external links to posts that currently exist on my blog?

    Sorry for the lack of knowledge on this matter, any help would be very much appreciated.

    Regards,
    Ssor

  2. ssor
    Member
    Posted 6 years ago #

    I just checked out this documentation which looks like it covers some of what I need to know.

    Still unsure how external links to my blog will be affected though?

  3. moshu
    Member
    Posted 6 years ago #

    Actually, in your case the "documentation" should be this:
    1. admin > Settings > General: change the two URL values; Save
    2. don't worry about the error message
    3. do NOT try to see your blog
    4. see #3
    5. via FTP, rename the directory blog to wordpress
    done.

    All the old external links will get a nice big 404 - unless you use a htaccess to redirect them to the new location.

  4. ssor
    Member
    Posted 6 years ago #

    Thanks for the help moshu. Just have a couple more questions.

    When you say:

    4. see #3

    Do you mean the third chapter "Moving WordPress to a New Server"?

    So what do I need to add to .htaccess to redirect the external links? If I wished to move my index.php file into the root with the .htaccess I could do it at this stage?

    Slightly off-topic, if I wanted to change the database name from blog to wordpress could I just change this via mySQL and reflect the changes in the config.php file? Would this cause any problems?

    Cheers,
    Ssor

  5. moshu
    Member
    Posted 6 years ago #

    4. see #3 - is a joke, sorry. Most people don't read and follow #3 from my list above and want to see their blog at that stage; and because they see only error, they panic... and do stupid things.

    - I am not a htaccess expert, you will have to google or find somebody else to help you.

    - No need to mess with the database. Nobody ever knows or cares what the name of your database is!

  6. ssor
    Member
    Posted 6 years ago #

    Cheers Moshu.

    I read somewhere that instead of a .htaccess re-direct I could do a search and replace on the database?

    Any know if this is easier than the .htaccess option?

    Any help is very much appreciated!

  7. Ivovic
    Member
    Posted 6 years ago #

    the htaccess redirects are for google results and bookmarks as much as they are for anything else.

    search/replace on your database fixes your own posts, but it doesn't fix people's bookmarks.

    In order to avoid redirecting people from your site to your site, I suggest doing both the search and replace *and* the htacess 301 redirection.

    The nice thing about 301 (permanent) redirections is that once people or search engines use those redirects once, they won't be required anymore, so you could leave them there for a few months and optionally choose to remove that.

    If your old posts still had old links in them, you'd have to keep the redirects there forever.

    IMO, do both.

  8. ssor
    Member
    Posted 6 years ago #

    Hi Ivovic,

    Thanks for your quick response.

    So, I need to do all the above to change the directory from /blog to /wordpress then change the permalink structure to "Date and Name Based".

    Can I then run this search and replace plugin? Not sure what I would add in the fields though...

    Then after that I can add a 301 redirect to my .htaccess file like this?

    Redirect 301 /blog/ http://www.bluntedpresents.co.uk/

    (I will be moving the index.php and .htaccess files to the root and having all the core files in /wordpress)

    Sorry, I'm not too clued up on this sort of thing.

    Thanks for your help in advance!

    Ssor

  9. Ivovic
    Member
    Posted 6 years ago #

    yeesh, if you're changing your permalink structure to date-based at the same time, you'll be doing more than can be covered by searching and replacing.

    in fact, you'll be doing more than can be covered easily using htaccess as well.

    got many posts? I have a feeling you'll be redirecting them one-by-one in your htaccess file, that is... unless your old permalinks were the query-string kind... and not another form of pretty permalinks.

    query string format will continue to work, so the redirection becomes a little easier.

  10. ssor
    Member
    Posted 6 years ago #

    Hmmmm,

    I have 388 posts, all with the 'standard' ?p=123 permalink structure.

    So that makes things a little easier? In that case, the 301 redirect I posted would work? What would I need to add to the fields of the search and replace plugin?

    Thanks!

  11. Ivovic
    Member
    Posted 6 years ago #

    nothing. as I said above, when you change permalinks from standard to something else, the standard ones will *continue* working, as well as your new format.

    it's only a real problem if you change from one type of pretty permalink structure to another.

    the deal is though, that if you want google to trawl your posts and see your old links in the new format, then you'll have to change them manually - search and replace won't do you any good.

    again, they WILL keep working, so you don't really *need* to do anything, and if you do anything at all, it will all be manual, and all your redirects will have to be quite unique, because you're your old query-style links have nothing descriptive in them.

    its easy to change /blog/apples/oranges to /wordpress/oranges/apples... but how will you know if ?p=324 relates to apples or oranges, programatically? the answer is, you can't.

  12. ssor
    Member
    Posted 6 years ago #

    Riiiight! I get ya. Thanks for all your help Ivovic.

    Ssor

Topic Closed

This topic has been closed to new replies.

About this Topic