how to remove folder public in laravel

核能气质少年 提交于 2019-11-28 11:37:40

问题


I have laravel setup on xampp located in http://localhost/laravel but to test it I have to go to localhost/laravel/public How do I get rid of the /public ? I would like to be able to access it directly through http://localhost/laravel


回答1:


The better way is to use a virtual host and you may check this answer to setup a virtual host. Also you may use this solution but it's not recommended because it tells to move all files and folders from public to your app root folder.




回答2:


  1. REMOVING .htaccess from root if you have created
  2. take all files and folder from public to root directory
  3. remove ../ from index.php
  4. rename OR remove public folder



回答3:


Try this article. It explains why .htaccess is not the way to go, and offers two alternatives. http://driesvints.com/blog/laravel-4-on-a-shared-host



来源:https://stackoverflow.com/questions/21959128/how-to-remove-folder-public-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!