Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

BrownieCoffee's avatar

Font awesome, and images not displaying in my online project

Hi there,

It's me again, my problem is in the title... Do you have any suggestion please?

I ran npm run production and optimized too

Thank you in advance.

0 likes
21 replies
MarianoMoreyra's avatar

Hi @browniecoffee

Check if you have SSL enabled at your website, that Font Awesome and Images should be linked with https protocol, otherwise they will fail to load.

jlrdw's avatar

What is your folder structure? You should be able to use the asset helper to display the images.

webso's avatar

Make sure to set your APP_URL in your .env file also.

Sinnbeck's avatar

Could you post a link to the page so we can see the issue?

Sinnbeck's avatar

The page does not work currently

Could you try adding this to your htaccess and see if the page works then?

DirectorySlash Off
BrownieCoffee's avatar

@sinnbeck the home page doesn't works and I don't know why. I tryed your piece of code on my .htaccess and it fails too.

Sinnbeck's avatar

It still redirect to /

Can you post your htaccess?

BrownieCoffee's avatar

@sinnbeck sure

<IfModule mod_rewrite.c>
   <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>



Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

I don't see any issue. I can only suggest to not run laravel from a sub directory

MarianoMoreyra's avatar

@browniecoffee I understand that you are using Laravel Mix right?

If that's the case, you can try disabling URL Processing and see if it works, as that feature of Mix moves your assets and rewrites your url() calls, and that might be causing your issue.

To disable it (according to docs) you should add the following:

mix.sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: false
    });

ref: https://laravel.com/docs/8.x/mix#url-processing

If that's the problem and you don't want to keep that feature disable, you'll have to change all your url() calls to use absolute paths instead of relatives.

Hope this helps!

MarianoMoreyra's avatar

So to be sure, you are using processCssUrls: false @browniecoffee ?

If that’s the case, please show how are you including your fonts and images

MarianoMoreyra's avatar

@browniecoffee although if you move your website to the root of your domain, you probably will fix this problem too, but I’m not sure if you saw my reply to that other post you made or if you tried what I’ve suggested

Please or to participate in this conversation.