How to set relative paths for image urls (2 posts)

  1. rchrisbishop
    Posted 3 years ago #

    I imported posts into WP. The photos for these old posts are stored in a folder called "images", which I uploaded to my wordpress root.

    The posts have simple html relative paths for the photos, such as <img src="images/example.jpg">

    The photos show up on my home page (the path reads as "mysite.com/images/example.jpg"), but disappear in each post, as the post is looking for "mysite.com/postname/images/example.jpg".

    How can I get the paths within the posts to drop the postname?

  2. Beee
    Posted 3 years ago #

    Add a slash before images, like this

    <img src="/images/example.jpg">

    Adding the slash means it starts looking from webroot first.

Topic Closed

This topic has been closed to new replies.

About this Topic