• kpagcha

    (@kpagcha)


    I set up a local environment to customize a friend’s WP blog. However almost none of the images are being displayed.

    The remote site’s URL is https://sitename.com and my local virtual host is https://sitename.dev.

    I have found a couple different cases when the images are not displayed:

    – The src URL looks like this: https://i1.wp.com/sitename.com/wp-content/uploads/xxxxxx and opening this link on the browser shows the image correctly. However there’s a srcset attribute with the URL https://i1.wp.com/sitename.dev/wp-content/uploads/xxxxxx and that causes a 504 HTML error because obviously there is no https://i1.wp.com/sitename.dev.

    – The other case just has a src URL like the previous srcset, it looks like https://i1.wp.com/sitename.dev/wp-content/uploads/xxxxxx so it is unable to load the resource.
    So it looks like the main problem is that i1.wp.com that is being prepended to my local URL and it’s completely messing with the routes.

    When editing posts from wp-admin all images are shown correctly. Well the featured image preview isn’t displayed correcly because it tried prepending i1.wp.com again but when selecting the image from the gallery it is displayed correcty (and the URL is https://sitename.dev/xxxxx).

    I have no idea where that prepended segment comes from but I would like to know how to either get rid of it or how to set up images correctly in my local environment.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Images not displayed when moving site to local’ is closed to new replies.