WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Use relative or absolute URLs for image src? (6 posts)

  1. searchen
    Member
    Posted 3 years ago #

    Is there any reason why I should not use relative URLs for the link to my images in posts?

    I have just had to change hosts, and many URLs were taken over with Absolute URLS to the old Host...

    Can I use the format: "../wp-content/uploads/2010/08/image.jpg"?

    I am only considering this for changing all the old URLs via "Search & Replace" plugin.

    Thanks
    Peter

  2. Is there any reason why I should not use relative URLs for the link to my images in posts?

    If you use relative URLs, your images won't show in feed readers as the URLs will be relative to whatever domain the feed reader is in. For example, if a subscriber is watching your feed in Google Reader, your images will attempt to load relative to google.com/reader.

  3. searchen
    Member
    Posted 3 years ago #

    Aha! Thanks for this clarification.

    My concern is that at present, I am testing on a temporary subdomain, provided by the new host, after moving a blog from another host.

    In the process of importing, about 50% (about 180) posts somehow brought over the Image src of the old Host. (How come the other 50% converted correctly??) Hmmm!?

    If I were to do a Search and Replace now, while testing, it would show the temporary domain. Probably it would then be intelligent to do a search & replace for the "real" domain and wait till I have propogated the domain?

    Thanks
    Peter

  4. Since you're just testing, I'd leave them relative now and do the final search/replace when you're ready to move to the main domain.

  5. searchen
    Member
    Posted 3 years ago #

    James... thanks for the advice.

    It's just that if half the photos in a photoblog do not display (during testing), it makes me a bit nervous!

    Cheers and thanks
    Peter

  6. You're welcome!

    If you need to, I see no reason to avoid changing them now, but you may encounter the same problem when you move.

Topic Closed

This topic has been closed to new replies.

About this Topic