简体   繁体   English

如何在laravel中删除文件夹public

[英]how to remove folder public in laravel

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 ? 我在位于http://localhost/laravel xampp上设置了http://localhost/laravel但为了测试它我必须去localhost/laravel/public如何摆脱/ public? I would like to be able to access it directly through http://localhost/laravel 我希望能够通过http://localhost/laravel直接访问它

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. 您也可以使用此解决方案,但不建议使用此解决方案 ,因为它告诉您将所有文件和文件夹从public文件移动到您的应用程序根文件夹。

  1. REMOVING .htaccess from root if you have created 如果已创建,则从root中删除.htaccess
  2. take all files and folder from public to root directory 将所有文件和文件夹从公共目录下载到根目录
  3. remove ../ from index.php 从index.php中删除../
  4. rename OR remove public folder 重命名或删除公用文件夹

Try this article. 试试这篇文章。 It explains why .htaccess is not the way to go, and offers two alternatives. 它解释了为什么.htaccess不是要走的路,并提供两种选择。 http://driesvints.com/blog/laravel-4-on-a-shared-host http://driesvints.com/blog/laravel-4-on-a-shared-host

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM