0

I followed this thread to change public folder to 'public_html'. Pages and routes runs well but Every image,css,js,resource on page from public folder cannot be loaded.

Image, css, js can't be loaded

404 (Not Found) in console

For example, i tried to load 127.0.0.1:8000/index.php file manually in public and this shows up..

The requested resource /index.php was not found on this server.

The file is exist but it can't be loaded..How to fix this? If i revert the public folder back, everything became normal again.

  • 1
    Did you update your config settings for the app URL? – Adam Jul 06 '18 at 14:19
  • Like this? https://imgur.com/a/HXSvQgB Still not working :( – Faisal Amirullah Jul 06 '18 at 14:28
  • 1
    Did you also change the document root in your server config? (and restarted Apache, or whichever you are running) – Nerbiz Jul 06 '18 at 14:28
  • It is on localhost, i restarted apache, added path.public bind in bootstrap/app.php and still not working. The strange thing is for example when i loaded localhost:8000/robots.txt (returning resource not found but the file exist in folder) but if i loaded localhost:8000/abc.txt (redirecting to main route because this file is really not exist) – Faisal Amirullah Jul 06 '18 at 14:34
  • Ah you're using artisan serve, my bad.. I always use this method, which appears to be needed for Artisan to also pick up the new public path: https://stackoverflow.com/a/33652169/1909468 – Nerbiz Jul 06 '18 at 15:01
  • Already did that before, sorry :( added custom app class MyApp.php, overriding publicpath function and by the way my view file is on public folder but there is no problem about that.. only image,css and js that cannot be loaded.. – Faisal Amirullah Jul 06 '18 at 15:10

0 Answers0