WordPress.org

Forums

[resolved] Changing blog address messes up uploads + URLs (10 posts)

  1. heriz
    Member
    Posted 7 years ago #

    Okay, this is what I wanted to do.

    My current blog site is here: http://www.lewisheriz.com/bleg

    I wanted to rename it to /legroom

    (I have my reasons.)

    I tried, using the Codex, the support threads (of which there is a lot on this subject) etc etc.

    It was fine, apart from the fact that all my links to my uploads were now broken, and the files themselves had the old path associated with them. From this I'm guessing:

    - You cannot change the blog url without having to manually change the links in each post

    - You cannot change the blog url and link to uploads directly

    I very much doubt this is the case, but I cannot find ONE thread/Codex post about this specific problem.

    My second problem:

    I decided to lump it and change back. I took all the same steps.

    Now (as you can see) my index page works, but none of my other pages can be found. They are there - my control panel says so.

    Any ideas on what's happened here?

    And please: be gentle. (Moshu, I'm looking at you.)

    Thanks

  2. heriz
    Member
    Posted 7 years ago #

    Ah - so this is a permalink problem.

    It works (as it is now) using the ugly format, but even if I update my .htaccess file once I've reset it to the format I want, it stops working again. Doesn't look like a very serious problem though.

    I'm still confused about how you're meant to change the address of your blog when you have a large number of uploads though. Hmm.

  3. heriz
    Member
    Posted 7 years ago #

    And the permalink problem is solved by changing the .htaccess permissions.

    My first query still stands though: How do you stop the upload links breaking when renaming your WP directory? If anyone knows, it'd be great to find out.

    It is of course quite possible that I was doing something wrong!

  4. heriz
    Member
    Posted 7 years ago #

    Hello hello,

    Thought I'd update this post.

    I've now moved the whole WordPress site to my root directory.

    I knew I'd have the same problem again, but I was following the Codex which links to this (very useful but apparently unrelated) site when discussing problems with broken image links, and thought it'd give me the answer. But there's nothing in it as far as I can see that refers to the problem of broken image links - unless the reference is there as a subtle way of saying 'edit the whole lot on your locally-held database, then update'.

    I've gone into my SQL database and tentatively tried changing the paths, but in the media library, nothing changes. I have to change the URL in each post in the control panel before images start reappearing.

    I'm up for manually changing the paths to each image, but I want to know that I'm doing it correctly and in the correct place before I blitz the whole thing.

    I've done many searches and I think answers would be helpful to others too... any pointers will be much, much appreciated.

    Thanks

  5. heriz
    Member
    Posted 7 years ago #

    AHA!

    After a few Google searches I found this help page on My Digital Life. Down the page it gives some SQL UPDATE commands which you must run in the SQL section of your mySQL panel once you've moved your site.

    I've just performed the operation and everything is fixed.

    Maybe this page should be linked in the Codex page rather than the current one?

  6. jgmeidal
    Member
    Posted 7 years ago #

    Thanks for the info.

    With WP2.5 I updated the new blog link in Settings, FTP transferred the directory, then ran these SQL commands:
    UPDATE wp_posts SET guid = replace(guid,'http://www.old-domain.com','http://www.new-domain.com');
    UPDATE wp_posts SET post_content = replace(post_content,'http://www.old-domain.com','http://www.new-domain.com');

  7. redheadedninja
    Member
    Posted 6 years ago #

    Thanks for the link, I found the other one to be useless as well, this one was easy and saved my butt. :)

  8. moshu
    Member
    Posted 6 years ago #

    I always used this plugin:
    http://wordpress.org/extend/plugins/search-and-replace/

    recommended for those that are not fluent in sql commands...

  9. davidsonsteve
    Member
    Posted 6 years ago #

    Wow, heriz, you're like your own tech support up there - good job! I just migrated a non-live WP on my localhost to a[n almost] live place on the web and was devastated, thinking I'd have to re-upload all my pictures again. Your link worked great, and therefore won't hold that /legroom thing against you :)

    Thanks again to you, jg and moshu for the helpful tips; I owe all you guys a beer. You're invited too, redheadedninja, I'm in a very good mood right now.

  10. kenmcmahon
    Member
    Posted 6 years ago #

    Thanks Heriz.
    Had been treading much the same path as you when I can across your post and the link to that very useful info.

Topic Closed

This topic has been closed to new replies.

About this Topic