ixenox's avatar

New assets folder in /public giving 404 error

Hello ! please help, im having an issue with my code so basically i want to use a dedicated assets folder named "login-resources" , so i placed it in the public folder . example for a css file there : login-resources/css/main.css

So when i try to call this css in my blade template with : {{ asset('login-resoures/css/main.css') }}

i see only 404 errors on my consol when i visit that login page

have i messed-up somewhere ?

0 likes
6 replies
mvd's avatar

Hi Ixenox,

Code seems fine. Is the path to 'main.css' correct (view page source in your browser) ?

Grelav's avatar

try prefixing the url with / slash.

{{ asset('/login-resoures/css/main.css') }}

ixenox's avatar

when trying to access in the browser it returns 404

"Sorry, the page you are looking for could not be found."

ixenox's avatar

@Grelav , tried prefixing with / but not working still :

Failed to load resource: the server responded with a status of 404 (Not Found)

mvd's avatar

@ixenox so the path is not correct to the css. No typo, server/.htaccess config issue?

ixenox's avatar
ixenox
OP
Best Answer
Level 1

Update : The problem was : the folder of the new resources : login-resources was owned by user 0 group 0 while laravel was owned by user 33:33

just ran a Chown -R and it solved the problem hopes this helps others

Please or to participate in this conversation.