Deploy to shared hosting, not loading assets.

When deploying to shared hosting, there are assets of course, but for some reason unknown to me, they are not loading. Almost not at all in Firefox, only partially in Chrome (which is also a mystery to me). You can try to look at it: https://dev.forvix.work/admin or /wms
Solution
Just found an article and it solved it for me.
Article: https://medium.com/@dedanirungu/how-to-host-a-laravel-project-on-a-shared-hosting-via-cpanel-5bd54f9a8f1a

Only to have .htaccess in root with this content:


<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  #Loading PHP as if is public/ from /
  RewriteRule ^$ public/index.php [L]
  #Loading page as if is public/ from /
  RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

  RewriteRule (^\.|/\.) - [F]

  <Files .env>
     order allow,deny
     Deny from all
  </Files>


</IfModule>
Medium
Add a .htaccess file to the root and there will be no need of copying or editing files from the public folder.
Was this page helpful?