WordPress.org

Ready to get started?Download WordPress

Ideas

Relative path for images/uploads?

  1. Class
    Member

    A while back I moved my blog to a different domain and had to update the path to all the post images.

    Maybe using a relative path to the images in posts would be a good idea? Maybe a setting somewhere to alter the path?

    IE 'wp-content/uploads/2007/02/image.gif' instead of 'http://domain.com/wp-content/uploads/2007/02/image.gif'

    Posted: 7 years ago #
  2. foolswisdom
    Staff

    12345

    Mike hopes this is fixed in WordPress 2.2
    Ticket #2682
    Remove db store of absolute path for uploads

    Posted: 7 years ago #
  3. tdavislaserapp
    Member

    12345

    Had this issue myself, I was able to do a find and replace using MyPHPAdmin. I did a search for the path as appeared in the post contents, and replaced the old url for the new url.

    Posted: 6 years ago #
  4. aalaap
    Member

    12345

    Has this still not been fixed?

    Posted: 5 years ago #
  5. Ben Huson
    Member

    A good idea, but really anywhere where you can access content as an RSS feed should have absolute paths so that if the RSS feed is displayed on a different site all the paths to images would be correct.

    Posted: 5 years ago #
  6. jstnjns
    Member

    Would be nice if there was a tag similar to the <!--more--> tag that was parsed by the WP engine. Like:

    <!--img:"/wp-content/uploads/2007/02/image.gif"-->

    This could be put in posts, and there could be a template tag like:

    wp_image('/wp-content/uploads/2007/02/image.gif');

    or even

    wp_image(UPLOADPATH.'2007/02/image.gif');

    I don't see why this easy doable, and there is plenty of need for it. Anybody that has transferred a blog runs into this. Also, trying to run a development/development transfer is more of a hassle than it should be. I often transfer a site (http://staging.site.com/) to live (http://www.site.com/), but with plenty of extra steps to get images (of all things) linking correctly.

    Posted: 5 years ago #
  7. Duane Storey
    Member

    12345

    A solution to this might be to use relative paths for the actual posts, and convert those to absolute URLs using a hook for all the feeds. We're currently working on a site-to-site transfer plugin, and this is an issue we're facing as well.

    Posted: 5 years ago #
  8. Dave Redfern
    Member

    12345

    i desperately want this to happen. have had to move several wordpress blogs to different domains and servers and they are never as easy as they should be - mostly because of these relative paths.

    Posted: 5 years ago #
  9. mktanny
    Member

    why not a use a plugin to redirecct all the url's that you have changed and ask major search engines for a re-approval.

    Posted: 4 years ago #
  10. pritchie
    Member

    12345

    Yes please, in fact why not use relative paths whereever possible for internal resources? Not only IMHO are they more robust when it comes to future site changes. There is also a saving on the page foot print with less characters being required for each URL. I'd suggest using a relative from the site root, eg. all paths start with '/', in my experience this causes less problems, but you're the experts.

    WP rocks, now where's the coffee?

    Posted: 4 years ago #

RSS feed for this topic

Reply »

You must log in to post.

  • Rating

    12345
    223 Votes
  • Status

    Duplicate of another idea