Images are not displayed on my site

Post Reply
User avatar
dpeca
Site Admin
Posts: 239
Joined: Fri Jun 19, 2020 9:59 am
Images are not displayed on my site

Post by dpeca »

Possible reasons:
  • You are loading images from http while you are loading site from https
  • Your CMS is rewriting URL of images/static files

Tags:

User avatar
dpeca
Site Admin
Posts: 239
Joined: Fri Jun 19, 2020 9:59 am
Re: Images are not displayed on my site

Post by dpeca »

You are loading images from http while you are loading site from https

You should check page source to see if this is really happenning.
If yes, you can migrate site database to https using v-migrate-site-to-https script.

User avatar
dpeca
Site Admin
Posts: 239
Joined: Fri Jun 19, 2020 9:59 am
Re: Images are not displayed on my site

Post by dpeca »

Your CMS is rewriting URL of images/static files

In this case go to:

Web -> Edit (domain) -> Proxy template -> hosting-legacy

hosting-legacy template will pass requests for non-existent static files to Apache (where .htaccess will resolve it with mod-rewrite)

hosting template will NOT pass requests for non-existent static files to Apache.

When you have shared server with lot wordpress sites, it's common that some sites is linking image files that does not exists.

Well, all those http requests (to non-existent static files) goes then to Apache and then to PHP-FPM, and then the whole WordPress will be initialized, with mysql connection to mysql... just in order to say "Ahhh, it's really 404".

Now imagine wordpress site with 10 non-existent images per page.... with visitors every second.

That's 10 requests to wordpress per second.

So, this new hosting template will save a lot of CPU time on shared hosting server.

We are just explaining why we modified default hosting template.


Conclusion... if your CMS uses mod_rewrite to route images/CSS/JS, just put hosting-legacy template - and everything will works like in Vesta/Hestia.


Post Reply