WordPress.org

Ready to get started?Download WordPress

Forums

Media URL Structures change with new Blog Address (11 posts)

  1. DaveLindberg
    Member
    Posted 1 year ago #

    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?

  2. adpawl
    Member
    Posted 1 year ago #

  3. DaveLindberg
    Member
    Posted 1 year ago #

    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.

  4. adpawl
    Member
    Posted 1 year ago #

    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');

  5. DaveLindberg
    Member
    Posted 1 year ago #

    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.

  6. adpawl
    Member
    Posted 1 year ago #

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

  7. DaveLindberg
    Member
    Posted 1 year ago #

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

  8. DaveLindberg
    Member
    Posted 1 year ago #

    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!

  9. adpawl
    Member
    Posted 1 year ago #

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

  10. DaveLindberg
    Member
    Posted 1 year ago #

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

  11. adpawl
    Member
    Posted 1 year ago #

    Unfortunately, i am a visual person. :)
    Write to me at adpawl.it[at]gmail.com

Topic Closed

This topic has been closed to new replies.

About this Topic