• Hi;

    I recently changed my permalinks to a custom structure:
    https://mydomain.org/category/postname

    Using this string in the “Custom” field under Settings | Permalinks
    /%category%/%postname%/

    It works great.

    However in some WordPress Pages on my blog I have a number of images I point with static links going to my server space

    For example:
    https://myblogdomain.org/img/rdmdeng.jpg

    When I use custom permalinks none of these images appear on the WordPress Pages/Posts. When I switch back to the default permalinks the images appear.

    What is going on?

    Is there anyway I can switch to the custom permalink format without messing up these images?

    Thanks in advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • Changing permalinks won’t automatically change any old static URLs you have to non-wordpress URLs in content. That’s far beyond what permalinks do and how they work by mod rewrite.

    Use something like Search RegEx to search and replace through all posts and pages to fix old URLs, and move the images into /wp-content/uploads/ for future-proofing.

    Thread Starter tinker123

    (@tinker123)

    I used relative paths to my img directory in my image tags, ie:

    ../../img/rdmdeng.jpg

    Without custom permalinks this is an example of an image URL
    https://myblogdomain.org/img/rdmdeng.jpg

    With custom permalinks turned on, the system inserts “blog” into the final URL to the img, braking it:

    https://bundergroundrailroad.org/blog/img/rdmdeng.jpg

    I have between 5 – 100 images, before I do search and replace…..and QC do you know for sure there isn’t a way to get wordpress not to stick that blog/ into my img URLs?

    Is there anything special about the wp-content directory?

    Thanks in advance

    You could move wordpress to root and as a result get rid of the /blog/ and then your links will work. It’s best to stay with the standard wordpress directories, but not required.

    Thread Starter tinker123

    (@tinker123)

    How would I move wordpress to root?

    Create a new blog in root, export my existing blog and import it into the new blog?

    Thread Starter tinker123

    (@tinker123)

    I decided not to move the blog.

    I figured out that if I moved the images directory to where the permalinks was munging the links to be I would only have to fix the image URLS in 13 “pages” versus 13 “pages” + 50 “posts”.

    Thanks much for the help.

    I really like that search and replace plugin!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Permalinks messing up static URLs to images’ is closed to new replies.