【发布时间】: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