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.
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.
@marianomoreyra Hi. I have no ssl with my free hosting I did deployment via FTP
@browniecoffee do you get any errors at Developer Tools console or Network tab?
What is your folder structure? You should be able to use the asset helper to display the images.
Make sure to set your APP_URL in your .env file also.
Could you post a link to the page so we can see the issue?
@sinnbeck sure ! http://www.goshr.go.yo.fr/goshr/
@jlrdw my folder structure on shared hosting
- /
- goshr-core/ (all folder and files exept public/ from my app)
- public_html/
- goshr ( content of the public/ from my app)
The page does not work currently
Could you try adding this to your htaccess and see if the page works then?
DirectorySlash Off
@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.
It still redirect to /
Can you post your htaccess?
@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>
Have you applied a symbolic link yet.
I don't see any issue. I can only suggest to not run laravel from a sub directory
@sinnbeck @jlrdw the paths of the images and icons are wrong.
It will be https://www.goshr.go.yo.fr/goshrfonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e instead of https://www.goshr.go.yo.fr/fonts/vendor/font-awesome/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e
Do you know how can I update that please?
@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
});
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!
@browniecoffee remember that if you make the suggested change, you'll have to run:
npm run production
@marianomoreyra yes I'm using it.
I ran npm run production
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
@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
@marianomoreyra I used processCssUrl: it given me nothing. I moved my website in root of my domain and than it works
Please or to participate in this conversation.