WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Updating Upload Permalinks (11 posts)

  1. asphaltcowboy
    Member
    Posted 8 years ago #

    Hi all,

    I recently moved my blog from the root of my server (http://www.daniel-lim.co.uk/) to a subdomain called "blog" - This allows me to have my blog at http://blog.daniel-lim.co.uk/ (although on the actual server it's listed as http://www.daniel-lim.co.uk/blog/). I've updated the WordPress address and blog address URIs match this (http://blog.daniel-lim.co.uk/) and that seems to work fine, but the images and videos I've already uploaded no longer link properly - they don't seem to be updated. All I get is the image name - WordPress is still trying to find them in http://www.daniel-lim.co.uk/wp-content/uploads/ and I don't know how to redirect them so it looks in http://www.daniel-lim.co.uk/blog/wp-content/uploads/ (or http://blog.daniel-lim.co.uk/wp-content/uploads/ - which I imagine would also work) instead.

    Surely I don't have to go through my database and edit all the entries?

    Please help!

  2. moshu
    Member
    Posted 8 years ago #

    1. I've updated the WordPress address and blog address URIs match this (http://blog.daniel-lim.co.uk/)
    If what you said about your setup is true - then only ONE URI should point to the new address.
    See: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Surely I don't have to go through my database and edit all the entries?

    Well... yes and no. I took a look at some of your entries with this problem. All your images are using the full URL's, and they're in the post themselves. So yes, that full URL is in your database and in the posts.

    So if you do want to edit your database, the thing to do would be to search out any references to ht.tp://daniel-lim.co.uk in your posts, and then simply delete them. This would make all your image references (and any other references) relative links instead of absolute links, and it would make your data able to switch around between hostnames more easily.

    However, there is an alternative. Here's an example link I found in one of your posts:
    http://daniel-lim.co.uk/wp-content/uploads/2006/02/dl_mp_blocktest.jpg

    This returns a 500 server error. I don't know why, exactly, but if you used some rewrite rules, you could redirect that traffic to the new URL by adjusting the hostname from daniel-lim.co.uk to blog.daniel-lim.co.uk without too much trouble. This means that you don't have to go back any edit your database, as such.

    In the future, using relative URLs for links to files on your own site will prevent this sort of thing from occurring.

    One somewhat easy way to edit your database would be to make a full and complete backup of it, decompress the backup, and then edit the files with a text editor. Search/Replace is your friend. Then restore the database from the modified backup.

  4. asphaltcowboy
    Member
    Posted 8 years ago #

    That's an idea, will try it out. So, are permalinks a bad thing then?

  5. moshu
    Member
    Posted 8 years ago #

    I don't think anything in this thread has to do with permalinks - it's all about using correct path in the image links/code.

  6. asphaltcowboy
    Member
    Posted 8 years ago #

    How come it doesn't update the links when you change the WordPress/Blog address?

  7. moshu
    Member
    Posted 8 years ago #

    I am not sure I understand your question. Try it again.
    Which links? Who should update what and why?

  8. Nazgul
    Member
    Posted 8 years ago #

    You added those links to your post while adding entries to your blog. Therefore there's no relation/link between your WordPress configuration and those links. And WordPress can't change what it doesn't know about.

  9. asphaltcowboy
    Member
    Posted 8 years ago #

    But the links were all added through the upload box in WordPress, and it certainly seems to keep track of them, is it wrong to expect them to update if you move the site AND let the site know that it's moved? I just thought it might be part of the permalink updating...

    clearly not :)

  10. moshu
    Member
    Posted 8 years ago #

    Permalinks are the "permanent links" to your posts and Pages in the blog. Nothing else.
    They do not have any effect on whatever links/path you put into your posts - that's part of the content of your blog. It doesn't matter that you manually type those links into the post or you use some "comfortable' features of WP to save you the typing.
    Seemingly you are still confused about permalinks and path to images.

  11. asphaltcowboy
    Member
    Posted 8 years ago #

    No no, I do understand the difference, it's jsut a less fiddly name than "the direct path to the uploaded files" :)

Topic Closed

This topic has been closed to new replies.

About this Topic