Welcome Guest, Not a member yet? Register   Sign In
Images and css files not loading on live server
#2

(05-14-2020, 06:10 AM)Tony.Green Wrote: I am using the latest ci4 and all looks fine on local host but on web server the images are not appearing. 
I have put images into into public/images and css into public/css.
All config files look fine and everything else including database is working.
I used the html helper to construct link and img tags as well as doing it manually for comparison but neither work on the web server however everything is working correctly on the local server?
Any help would be appreciated.

I have the images working now but I have not resolved the css file issue yet.

Turns out that I chose a png file for my testing that was 74k in size? When I used a jpg or gif file it worked just fine and when I tried a smaller png file it also worked. So I am intrigued about what is causing the image display problem?
Any ideas anyone?
I can work around this for now but I am hoping that this will not be a show stopper further down the line?

Just for anyone else that has to try and fix something like this I have found that having my images in an images folder under public references the images just fine using any of these examples:

<img src="images/someimage.png" />

<?php echo img('images/someimage.gif'); ?>
(of course with this you will have to have loaded the helper('html') in your controller before echoing the view as it is using the img function from the ci helper)

<img src="<?php echo base_url('images/someimage.jpg'); ?>
Reply


Messages In This Thread
RE: Images and css files not loading on live server - by Tony.Green - 05-14-2020, 09:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB