Just shows that you have not installed your site correctly. You are serving the root of the project and not the public folder.
This is a big security risk as well as having all your URLs polluted with /public/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, i had a client who already bought a shared hosting which i was obliged to deploy there an api of a website, i searched for solutions to run artisan commands inside the shared server. I faced a problem where i had to recreate a symbolic link for the storage, since i don't have ssh access, i used to run the artisan commands:
Route::get('/', function () {
Artisan::call("cache:clear");
Artisan::call("config:clear");
Artisan::call("optimize:clear");
Artisan::call("storage:link");
});
it created the sys link (screenshot)
but when i visite mydomain.com/storage/image.png it throws a 404 not found error, contrary when i try mydomain.com/storage/app/public/image.png, it works normally, even when i double click on that sys link it takes me to the storage/app/public folder (like it should to be).
I don't know if i gave the whole description for the problem, any idea how to fix it?
thnx
your public folder should be the one treated by the webserver as document root
it's difficult to give examples without knowing what type of hosting it is
Please or to participate in this conversation.