我做了路由,但是 apache 服务器看不到那个路由。 Laravel 欢迎页面没有问题,但是当我尝试在 View 中创建另一个文件夹时。 Apache 看不到该页面。 404 未找到弹出。
这是路线和 Controller 代码
Route::get('/pages', 'Pages@index');
和 Controller
function index(){
return "test";
还有我的 httpd 我的文档根目录:/var/www/html/laravel/public
模块目录:
DirectoryIndex index.html index.php
我还需要更改其他内容吗?使这条路线可以访问?
最佳答案
在 centos 7 中,None
--to-> All
让它很好。
<Directory /var/www/html>
. . .
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None --> All
. . .
</Directory>
关于laravel - 为什么 Apache(centos 7) 看不到我创建的路由?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52473947/