Before anyone posts an archived solution to this problem, it's been the second day I'm trying to figure this out, I went through all the posts possible, even though most of them are 5-6 years old. I have a laravel project I was working on and I had to put it aside for a while. After getting the resources I wanted to finish the project, when I realised it's not loading the assets from the public folder anymore. It loads the content of the view, but it's trying to acccess the old public folder(the one within the root). I had the public folder out of the root directory from the very beginning and it all worked well. I changed PHP version since then, but I don't think that should have any impact on it. My approach on loading the folder was as follows:
Binding the puplic path in the index.php
$app->bind('path.public', function() {
return __DIR__;
});
This is my .htaccess content in the root directory
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
</IfModule>
But I tried all sort of version found in previous question solutions. Application runs on artisan server. Any idea why my application not accessing that external public folder anymore?