【问题标题】:Laravel 5 showing directory structure instead of index.php on xampp localhostLaravel 5 在 xampp localhost 上显示目录结构而不是 index.php
【发布时间】:2015-09-30 09:12:30
【问题描述】:
http://localhost/laravel_test/

而不是路由到上面的 index.php URL 只是打印 /laravel_test 的索引(目录结构)。

我可以通过以下方式访问索引页面:

http://localhost/laravel_test/public/index.php

我尝试通过在 laravel_test 的公共目录中添加以下行来修改 .htacess 文件仍然没有变化:

DirectoryIndex index.php

【问题讨论】:

  • 打开http://localhost/laravel_test/public/看到什么?
  • localhost/laravel_test/public 我看到 index.php
  • 这就是它的本意。如果您正在运行 Apache,则可以使用 virtualhost,或编辑 windows 主机文件来执行此操作。如果您愿意,您也可以正确地将内容向上移动一级,但这可能会很痛苦。 tutsnare.com/remove-public-from-url-laravel

标签: php .htaccess xampp laravel-5


【解决方案1】:

这是一篇旧帖子,但如果这对任何人都有帮助,我遇到了这个问题,因为我的 httpd-vhosts.conf 文件指向 C:/xampp/htdocs/MySite 而不是 C:/xampp/htdocs/MySite/public。这是一个愚蠢的错误,但你知道每个人都会偶尔犯这种错误。

【讨论】:

    猜你喜欢
    • 2017-11-21
    • 1970-01-01
    • 2018-01-27
    • 2016-12-24
    • 2021-11-07
    • 2015-10-04
    • 2014-02-18
    • 1970-01-01
    • 2011-02-21
    相关资源
    最近更新 更多