Is the .env file in that folder as well? If so, remove it at once (as anyone can get access to it).
Aug 27, 2021
4
Level 5
Laravel 6 CSS and JS 404 error after deployment to shared hosting
I have deployed to cpanel shared hosting, all the laravel folders and files are located in the public_html folder which is the root directory. Here is my question how do I fix the 404 error for CSS, JS and images? Here is my folder structure from cpanel file manager
- public_html
- app
- bootstrap
- config
- public (all css, js here) ........ .......
- index.php
- server.php ........ -webpack.mix.js. I get the 404 error for CSS,JS and some images. if enter www.mysite.com/public/style.css in browser I can see the style.css file open, whereas www.mysite.com/style.css doesn't show the style.css file.
I used <link rel="stylesheet" type="text/css" href="{{ URL::to('style.css') }}"> got 404 error.
I need to update the public path but not sure where, please help, thanks
Please or to participate in this conversation.