I’m adding Gatsby-source-wordpress with Headless Mode (https://wordpress.org/plugins/headless-mode/) to an already existing website using Contentful. Actually, blog.website.com (wordpress) redirect to website.com/blog/.
Problem : every wordpress post « content » images, appear in the HTML with the good URL src (which works and goes to the initial subdomain that is hosting the wordpress website and images : https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-1024x768.jpg).
Post content displayed with <div className={styles.content} dangerouslySetInnerHTML={{ __html: content }} /> return :
<img decoding="async" loading="lazy" width="1024" height="768" data-id="18" src="https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-1024x768.jpg" alt="" class="wp-image-18" srcset="https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-1024x768.jpg 1024w, https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-300x225.jpg 300w, https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-768x576.jpg 768w, https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-1536x1152.jpg 1536w, https://blog.website.com/wp-content/uploads/2023/08/IMG_0360-2048x1536.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px">
BUT the images are not displayed and an error appear in the chrome inspector with the error :
GET https://www.website.com/blog/wp-content/uploads/2023/08/IMG_0360-2048x1536.jpg 404
The final website is not hosting images, so it doesn’t work… but I don’t understand, where does this redirection come from, given that the URL in the HTML appears correctly?
Thank you