Images 404 only on the Search Console
Unanswered
Egyptian Mau posted this in #help-forum
Egyptian MauOP
Hello,
My website is in production and is functioning well. I don't have any issues with images when navigating the website. I am using Next.js <Image> component to optimize images. The images are served by my Strapi backend, which is hosted at http://api.domain.com.
However, when I check Google Search Console under "Crawl Stats," I see a 404 error for each image on the website. On my website, image URLs are formatted as follows: https://domain.com/_next/image?url=https://api.domain.com/...
When I go to the "Crawl Stats" page, all the images appear as 404 errors because the subdomain is missing in the URL. Google lists the images like this:
https://domain.com/uploads/images.png
When they should actually be:
https://api.domain.com/uploads/images.png
I don't understand where Google is finding these incorrect image URLs. I've checked and scanned the website multiple times, and all robots/crawlers do not report any 404 errors on images.
When I scan a page of the website using Google Search Console, I don't encounter any issues, and the render displays the images correctly.
I created 3 nextjs websites and I have the same issue on the 3 websites.
Is there anyone here who knows what's happening?
Thank you in advance.
My website is in production and is functioning well. I don't have any issues with images when navigating the website. I am using Next.js <Image> component to optimize images. The images are served by my Strapi backend, which is hosted at http://api.domain.com.
However, when I check Google Search Console under "Crawl Stats," I see a 404 error for each image on the website. On my website, image URLs are formatted as follows: https://domain.com/_next/image?url=https://api.domain.com/...
When I go to the "Crawl Stats" page, all the images appear as 404 errors because the subdomain is missing in the URL. Google lists the images like this:
https://domain.com/uploads/images.png
When they should actually be:
https://api.domain.com/uploads/images.png
I don't understand where Google is finding these incorrect image URLs. I've checked and scanned the website multiple times, and all robots/crawlers do not report any 404 errors on images.
When I scan a page of the website using Google Search Console, I don't encounter any issues, and the render displays the images correctly.
I created 3 nextjs websites and I have the same issue on the 3 websites.
Is there anyone here who knows what's happening?
Thank you in advance.
4 Replies
Egyptian MauOP
It's big issue for Google to have these 404 coming from nowhere no one have an idea ? ðŸ™
thank you in advance !
thank you in advance !
Egyptian MauOP
On the NEXT_DATA images path are returned in relative way like :
On the render I add the full path : api.domain.com.
So the images are well rendered with <Image> in NextJs.
If strapi return directly the absolute path like this :
I don't think google image crawler take the url of images in the NEXT_DATA but it's the only thing I found.
"url":"/uploads/thumbnail_b64ef2b5b2.webp"}}On the render I add the full path : api.domain.com.
So the images are well rendered with <Image> in NextJs.
If strapi return directly the absolute path like this :
api.domain.com/uploads/thumbnail_b64ef2b5b2.webp should it can fix the issue ?I don't think google image crawler take the url of images in the NEXT_DATA but it's the only thing I found.
My website domain is domain.com/ not api.domain.com so it can be the issue when google find the path of images in the NEXT_DATA
Egyptian MauOP
No one already had this issue ?