S
S
Sergey2017-08-26 02:02:44
css
Sergey, 2017-08-26 02:02:44

css and js not working on hosting, how to fix it?

I uploaded my test site to the hosting and everything seems to be fine, but css and js do not work, I wrote

the paths in different ways:

1 way:

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


2 way:

<link href="/css/style.css" rel="stylesheet" />

3 way:

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


Maybe something should be written in the .htaccess file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
artemmityushov, 2017-08-26
@artemmityushov

This problem occurs for everyone who unfolds the lara for the first time on their own. Look where your path goes, write not on index.php, but on server.php, then your paths will knock directly on the public folder, otherwise it will be like you have now, it thinks that the front root is the root of the project folder, and not public folder.
If you are too lazy, then simply transfer the entire contents of the public folder to the root of the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question