Support » Localhost Installs » 404 error on some image access after copying site

Viewing 6 replies - 1 through 6 (of 6 total)
  • D:\Sitename\wp-content\uploads\2012\12\22\postname\dsc01222.jpg

    and on localhost where the 404 error is created:

    <p><img alt=”DSC01222″ class=”alignleft size-medium wp-image-8685″ height=”224″ src=”http://localhost:54603/wp-content/uploads/2012/12/DSC01222-400×224.jpg” width=”400″ /></p>

    are you missing “Sitename” ?
    http://localhost:54603/Sitename/wp-content/uploads/2012/12/DSC01222-400×224.jpg

    No, that’s not it, unfortunately. I wish it were, although than the question would be: how come?

    If you compare the localhost code with that on the remote server the statements are exactly the same aside from the URL. That’s what’s so puzzling: how can the same code produce different results?

    The localhost html page code is stored in the MySQL database and was converted from the original using Wordepress procedures.

    Ok check your mysql database for localhost:12345// and you’ll have to do a search and replace for ‘//’ to ‘/’

    nice idea but no, there were no // to replace

    The problem definitely has to do with permalink settings because some stuff I can get to work with one setting and other stuff with another on localhost. Only on the remote server everything works.

    The problem I am trying to resolve:

    On localhost the image has a href=http://localhost/2012/12/21/page_name/dsc123456 this is NOT working, i.e this reference is not found.
    However, the src=http://localhost/wp-content/uploads/…. is working

    On the remote server
    href=http://site.com/wordpress/2012/12/21/page_name/dsc123456/ this is working.

    Obviously replacing “site.com/wordpress” with localhost in the database does not do the trick as all the href references containing ../page_name/… are invalid on localhost. The physical path does not exist.

    ok, in principle I found what I have to do in wp_posts/post_content:

    find in href= the string: “localhost/year/”

    copy from that record the id# from: rel=”attachment wp-att-id#”

    replace in that record in href= the string
    “http://localhost/year/….” with
    “http://localhost/?attachment_id=id#”

    What I am missing now is a way to accomplish that programmatically. I assume there might be a way with an SQL query, or with other software tackling an exported sql file?

    I have no knowledge whatsoever with SQL queries or how to do it otherwise. Any help is very much appreciated as there are several thousand records that need to be changed.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘404 error on some image access after copying site’ is closed to new replies.