404 error on some image access after copying site
-
I thought I successfully copied my site from a remote server to my PC by using all the advice I could find on the WordPress sites by changing URL information in my local MySQL database and in WordPress.
Most everything works but I have a persistent 404 error when trying to access some detailed blog information that deals with attachments.
Let me try to describe the access procedure when it works:
(I tested that creating a new post with image)
localhost:12345/indexphp/blogs/
and on the remote server
http://www.site.com/wordpress/blogs/
shows my main blog page.When selecting a blog I get locally
localhost:12345/indexphp/2012/12/25/pagename/
and on the remote server
http://www.site.com/wordpress/2012/12/25/pagename/
Both show the blog with all text and images.
The images are identified as
localhost:12345/index.php/2012/12//25/pagename/dsc01234/ etc.
and on the server as
http://www.site.com/wordpress/2012/12/25/pagename/dsc01234/ etc.And when I select one of these imags on localhost I get a screen localhost:12345/index.php/2012/12//25/pagename/dsc01234/
with that image and the image is identified as
localhost:12345/wp-content/uploads/2012/12/DSC1005.jpgSimilarily on the remote server I get
http://www.site.com/wordpress/2012/12//25/pagename/dsc01234/and
http://www.site.com/wordpress/wp-content/uploads/2012/12/DSC1005.jpgBut here is what happens when I try to do the same procedure with a post downloaded from the remote server to localhost:
localhost:12345/indexphp/2012/12/22/pagename/
shows the blog with the text and images.However, when I now select one of the images I get the following error message:
HTTP error 404.0
Requested URL localhost:12345/2012/12/22/postname/dsc01222/
Physical Path D:\Sitename\2012\12\22\postname\dsc01222\Of course, the proper physical path would be:
D:\Sitename\wp-content\uploads\2012\12\22\postname\dsc01222.jpgThus when I type in the proper URL by adding index.php:
localhost:12345//index.php/2012/12/22/postname/dsc01222/
I get the proper screen w/o an error.So why is the index.php reference missing from the requested URL?
It seems to me that my local database still has some flaws. So I compared the original database entries (wp-posts) on the remote server with the same entries on my localhost. Here is the comparison.
post_content on the remote server where the attachment is shown properly:
<p><img alt=”DSC01222″ class=”alignleft size-medium wp-image-8685″ height=”224″ src=”http://www.site.com/wordpress/wp-content/uploads/2012/12/DSC01222-400×224.jpg” width=”400″ /></p>
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>
Similar html code; only the URL is different. On the remote server it works, on the localhost I get the error.
Any help on getting this resolved is very much appreciated.
- The topic ‘404 error on some image access after copying site’ is closed to new replies.