1

I'm trying to make my laravel app live on godaddy, I moved the public folder content to the root public_html folder and the app is up and running, here is the link, css file and images are not loading. why is that?

my link to css file is gives the write path when I use inspect element on browser. but not really working.

here the code to link to css file:

<link href="{{ URL::asset('css/style.css')}}" rel="stylesheet">

I also tried:

<link href="{{ asset('css/style.css')}}" rel="stylesheet">

and:

<link href="{{ HTML::style('css/style.css')}}" rel="stylesheet">

none is working for me on hosting but working fine on localhost

my images code to link images:

{{ URL::asset('images/logo.png')}}
6
  • did u put css and image folder in public folder ? Commented Apr 28, 2018 at 7:41
  • yes, not working too Commented Apr 28, 2018 at 7:43
  • where did u put your index.php file ? Commented Apr 28, 2018 at 7:44
  • at the hosting 'public_html' folder Commented Apr 28, 2018 at 7:45
  • try adding {{ asset('public/css/style.css')}} Commented Apr 28, 2018 at 7:51

3 Answers 3

0

I think this is not hosting issue, your style.css not exists in css folder and images in images folder. Upload these files. If you see in console, you will find a 404 not found error.

style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
logo.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
slide1.jpg:1 Failed to load resource: the server responded with a status of 404 (Not Found)
slide2.jpg:1 Failed to load resource: the server responded with a status of 404 (Not Found)
financial.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
slide3.jpg:1 Failed to load resource: the server responded with a status of 404 (Not Found)
/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)
style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
Sign up to request clarification or add additional context in comments.

Comments

0

the problem that on hosting you should type the full path from public_html folder on hosting

Comments

0

This is a another way to deal missing js and css file if file are present but show 404 error Laravel link href invalid path

2 Comments

this should be in comment box or mark as duplicate since this not provides an answer to question
this is an answer to the question. The issue was not absence of file its related to missing file path at shared hosting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.