Reputation: 365
I am using laravel and deployed my application on server application folder path /var/www/app
So when i run the url with public, css will load. http://xxx.xxx.xxx.xxx/app/public/
But when i remove the public from url, css will not load. http://xxx.xxx.xxx.xxx/app/
Css and js files are located into the public folder
How can i solve this issue, can i change the asset path if yes please tell me the where the asset define
Thanks
Upvotes: 0
Views: 645
Reputation: 15457
Laravel is designed to run the code from the public directory, so files like .env
are protected from public access. Your server should be pointed to the public
folder.
However, if you want to change the public url, you can edit the index.php file and specify your own path:
// add after $app = require_once... in index.php
$app->bind('path.public', function() {
return __DIR__;
});
Upvotes: 1