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:Jump to 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:
...
Medium
How to Host a Laravel Project on a Shared Hosting via CPanel
Add a .htaccess file to the root and there will be no need of copying or editing files from the public folder.
12 Replies
do these files exist in the public folder?
try access any file/image in the public folder
make sure your .htaccess file is correct
Files are in the public folder. Seems like there are some problems with .htaccess, probably in the root. When i removed it, public is in URL and assets are loading. But cannot login (nothing happens).
.htaccess in root:
.htaccess in public folder:
try disable the one in the root?
404
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:
Medium
How to Host a Laravel Project on a Shared Hosting via CPanel
Add a .htaccess file to the root and there will be no need of copying or editing files from the public folder.
The more "funny thing" will be updates 😄
@Michal Čabala Michale, is there any way to change the root directory of the vhost to /public, so you can get rid of the root htaccess?
I think I don't understand your question well (probably of a language?) ...can you be more detailed?
I don't think it's possible in shared hosting to edit apache configuration
I'm lucky enough that my hosting have SSH etc., but I can't work with it yet, as I'm totally noob about it and still learning. And right now i have this hosting just for testing (and learning) purposes.
Just a question...in what is the difference between shared hosting and VPS for running Laravel and Filament app? If you have SSH, Git etc. on shared hosting?
will not all shared hosting offers SSH and more stuff, as you said you're lucky enough 🙂
not sure if this is default or not, but as i've seen most of the shared hosting has limitations
So I'm lucky enough...some time ago I was looking for hosting that can handle phpBB or Xenforo well and some guy gave me advice for this hosting. Right now I'm running phpBB there and recently added domain for testing my personal project in Laravel and Filament. It's like shared hosting, but probably looks like VPS as of the features- just take a look at it: https://exon.io/nexthosting (switch to english, the cheaper plan (about 15 EUR/month).
exon.io - nextHosting | Výkonný hosting s cPanelem
Jeden hosting pro všechno. Od PHP a Node.js až po Python nebo Ruby