WordPress.org

Support

Support » How-To and Troubleshooting » Media URL Structures change with new Blog Address

Media URL Structures change with new Blog Address

  • My test site, somedomain.com/dev, displays images from the Media Gallery using the expected URL, eg,

    <img src="http://somedomain.com/dev/wp-content/uploads/et_temp/filename-e1337786140409-19393_500x335.jpg" >

    However, when I try to launch the site by changing the WordPress address and Site address from “http://somedomain.com/dev/” to “http://somedomain.com/”, the image url for the same files switches to:

    <img src="/home/some_dir/public_html/another_dir//wp-content/uploads/2012/04/filename-e1337786140409-19393_500x335.jpg" >

    Note the double slash in the new URL. Now my links are broken, though the image files are still where they oughtta be. Really, the only thing that’s changed is the site address in the General Settings page. How can I override this unfortunate change in link structure?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thanks for the link. Just to double-check, are you referring to this item listed under “Additional items of note” ?

    Images link: image links are stored in “post_content” in the wp_posts table. You can use the similar code above to update image links.

    If you have in posts embedded images with incorrect paths, you must correct it in database.
    eg. using sql query like:
    UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://baddomain.com', 'http://mydomain.com');

    OK, I’ve gone through the documentation more thoroughly and still have the same issue.

    On the original site, I’ve used Search_Replace_DB v 2.1.0 and updated config.php to use a different URL for archival purposes; Works like a charm, and all image links are intact and menu links function properly.

    Then went through the same procedure to move the dev site to the live URL. The site is home page is functional, but:
    • the image links in the home page slider have again transformed their link structure: where we had URLs we now have (incorrect!) file paths.
    • navigation links now redirect to a 404
    • cannot access /wp-admin

    Here’s the site: http://www.florentinefilms.com/sherman/

    Any insight is greatly appreciated.

    Check your .htaccess file.
    Try go to Administration > Settings > Permalinks and click Save.

    I can access the database, and can revise .htaccess via ftp, but can’t get into the admin section.

    OK, thanks. I uploaded a new .htaccess and have regained access to the back end.

    However, my original issue is still here: the original image urls were working fine on the home page slider, but now they’re formatted as an image path. I could live with this if the image path was correct, but an extraneous slash is being inserted into the path. Thus, broken links!

    try replace in db
    /home/floren11/public_html/sherman//wp-content
    to
    http://www.florentinefilms.com/sherman/wp-content

    Good idea, but the search came up with zero results. Ugh.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Media URL Structures change with new Blog Address’ is closed to new replies.
Skip to toolbar