I currently host my Laravel website on Hostinger, but when I have a image on my page, the url doesn’t go to website.com/public/img_url, but it goes to website.com/img_url, does anyone know how this works on Hostinger, and how I can fix this?
Currently my whole project is in my public_html, with no other folders besides it.
2
Answers
The right solution was changing my htaccess to:
You should need to add a public inside asset function to access a public folder on the shared hosting server.
So you need to change the fetch path of files Example:
asset('user/photo.jpg')
toasset('public/user/photo.jpg')
in each line of code where you need to fetch files from the public directory.