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

Hi, thanks for the information. I don't use Apache + PHP anymore, so I can't help you there.
I use Nginx + PHP, and only know how to use different versions there.
Reply
#12

Did you try the below?

PHP Code:
<?= base_url('images/imagename.png');?>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#13

Thanks for your reply.
Yes I tried quite a few approaches but as I explained in great detail this is a server side issue because my css and images are being sent back to or served up to the browser as html docs and not in the format that they should be.
I am now looking for what is causing that problem and then a way to resolve the issue.
Reply
#14

Check your .htaccess file you can specify things for images etc; In there.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#15

Oh yeah, I forgot about you can force it that way, you can try to hotfix it with thos.

Code:
# MIME TYPES
<IfModule mod_mime.c>
    # JAVASCRIPT
    AddType application/javascript js jsonp

    # CSS
    AddType text/css css

    # IMAGES
    AddType image/gif gif
    AddType image/jpeg jpg jpeg
    AddType image/png png
</IfModule>
Reply
#16

Thanks for this idea!
I will give it a go later when I get back from walking my dog and let you know if it solves the problem I am having.
Reply
#17

@jreklund thanks for your suggestion but unfortunately it made no difference on my server. I have raised a ticket with my host to see if they can do anything at their end to resolve my issue and I will keep you updated so that if it gets resolved it may help someone else in a similar situation.
Reply
#18

@jreklund great news I have now managed to get this problem resolved with the help of my hosting gurus!!
Apparently on Apache hosting when using the htaccess file needs to have the SetHandler line changed so that it only affects php files and not all files as was happening on my original htaccess setup!!

Here is the modified first lines for the htaccess file:

<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-ea-php73-lsphp
</FilesMatch>

I hope this benefits anyone else in a similar situation.

Thanks again for everyone who has replied to this thread I do appreciate all of your help with this.
Reply
#19

Hi, great that you could solve the issue. It's sounds logical that you need to limit that filter. :-)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB