0

Hello guys I have just cloned a website I am having an issue.

In the clone there are just a handful of images that work. All the others appear as broken images in the front-end.

When you try to check the gallery almost all images appear blank (broken). When you try to view the image using it's link https://tester.medicalfa.gr/test/wp-content/uploads/2019/05/logo-2.jpg not even the permalink works for example you get an error 404 Not Found but the image is actually there according to the ftp. So someone must be wrong either the FTP or the browser.

I have already edited permissions to be on the safe side for the folders on 755 and files 644.

Also it seems that I can not even upload new images, all appear to be broken as well.

Edited to add the clarification comments

At first I thought of URLs as well so I used Search & Replace. I deleted htaccess and re-saved the permalinks to create a new one. After that I thought it could be that the permissions are set incorrectly so I edited that as well but still the images do not work for some reason. Also I thought that the image files (as some of them work) might be corrupted so I "replaced" the images from the original site (copy/paste).

I have tried everything that I can think of, also if the issue was the image URL then all images wouldn't work but there are a few that do work. For example this one. Also this is a clone website for dev purposes that means that the original website is actually there, had it been a URL issue the images would still appear but using the original website path though. I have used the plesk clone, I know it doesn't work 100%.

Fixed

Alright it seems that the culprit was a plugin. I have several plugins that I wouldn't use in the dev website, cleared cache and all the images popup up like mushrooms. I suppose it was the webp express that did the trick (removing it I mean) but it is only one of the four that I disabled and deleted. The list of the deleted plugins is:

  • cookie notice
  • quick page redirect
  • webp express
  • Yoast SEO
4
  • How did you clone the site? Did you use a database migration plugin so all the old-subdomain URLs are updated?
    – WebElaine
    Commented May 30, 2019 at 17:45
  • I used plesk, but already have edited the sql so that the old permalinks are replaced with the new ones.
    – JohnnyD
    Commented May 31, 2019 at 5:48
  • Did you search and replace with a plugin, or just go through with something like a text editor? It could be that serialization is getting in your way. Or perhaps there is a CDN, and when you load files through FTP they're not getting copied to the CDN - they can only be copied when you use the Media Uploader? You may want to check to see if your host has specific instructions for cloning, or if they can offer support for your particular case.
    – WebElaine
    Commented May 31, 2019 at 14:20
  • 1
    I used a plugin titled Search & Replace but to be honest I manually checked the DB afterwards just to be on the safe side. It wasn't a CDN issue the culprit was a plugin but I am not certain which one I have updated the main thread with the bold Fixed to let everyone know that I have managed to fix it. And maybe someone else has the same issue so it might be helpful.
    – JohnnyD
    Commented May 31, 2019 at 15:12

1 Answer 1

0

Image URLs are stored within the 'post' entry that is the media item.

So you can change each one manually via the Media screen. Or use a search/replace plugin to do it all at once. I like the "Better Search and Replace" plugin. Just enter the old URL's domain, and the new one. Use the 'test' button to see what it will do. If all is OK, then do it.

Database backups are always good before operations like these. (And a good thing in general.) I've used the above plugin several times without problems.

4
  • I have already tried that and that is the weird thing I have already replaced the image URLs. I have tried everything that I can think of, also if it was the image URL then all images wouldn't work but there are a few that do work. For example this one tester.medicalfa.gr/test/wp-content/uploads/2019/03/… . Also this is a clone website for dev purposes that means that the original website is actually there, had it been a URL issue the images would still appear but using the original website though. I have used the plesk clone, I know it doesn't work 100%.
    – JohnnyD
    Commented May 31, 2019 at 5:47
  • At first I thought of URLs as well so I used Search & Replace. After that I thought it was the permissions so I edited that as well but still the images do not work for some reason. Also I thought that the image files (as some of them work) might be corrupted so I "replaced" the images from the original site (copy/paste). I deleted htaccess and re-saved the permalinks to create a new one. And yes backups db and file are very important I do it every time I do a minor or major change.
    – JohnnyD
    Commented May 31, 2019 at 5:52
  • I tried your URL (in a private window) and got a security waning. Bad SSL cert? Or malware on your site? In any event, did not go further than that. Commented May 31, 2019 at 17:26
  • Nope, the ssl is for medicalfa.gr I didn't want to cache the subdomain on cloudflare so I have it use only the dns (and not the cdn) that is the reason for the Bad SSL error. but I actually fixed it now, I will mark your answer as the correct though the actually issue was because of some plugin.
    – JohnnyD
    Commented Jun 3, 2019 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.