img's in posts / pages - relative paths (2 posts)

  1. r4zv4n
    Posted 8 years ago #

    I've started designing a custom theme on my local server (http://localhost/project/), added a few pages with images (that I uploaded when editing the posts / pages).

    I then created a DynDNS.org alias for my server so the client could see it and continued theme development and then added a few more pages with uploaded images.

    In a few days, I'll be uploading the final version to their server and there'll be some more editing and uploading pictures.

    The problem is that the images uploaded in the first stage appear with src="http://localhost/project/...", the ones in the second stage appear with src="http://dyndns_alias.org/project/..." and the ones in the last stage will be src="http://www.their_server.com/..."

    Now, as I'm still in the second stage of development, the images uploaded in the first stage don't appear (I manually edited some, but there's a large volume of data to be handled) and I'm worried that in the next stage, I'll have even more work to do.

    Is there a way for images in posts / pages to have a relative path ? Is there a plugin for this ?

  2. r4zv4n
    Posted 8 years ago #

    In the meantime, I ran an SQL query on the WP DB to quickly replace img paths:

    SET post_content = REPLACE(post_content,'src="','src="http://dyndns_alias.org/')`

    However, a plugin (or maybe even integration) that would do a bloginfo('url') in the uploaded img's path would be great. Anyone know of one ?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.