laravel - 为什么 Apache(centos 7) 看不到我创建的路由?

标签 laravel apache routes centos

我做了路由,但是 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/

相关文章:

apache - 使用 htaccess 将别名重定向到主域

javascript - 如何在 router.get() 方法中传递 url 作为参数?

php - Laravel-5 排队邮件

php - 如何在 homestead 中更新 PHP 版本

php - 在多个 Apache 服务器上使用 session 数据库

php - 在 mod_rewrite 中允许百分比 (%) 符号?

javascript - 使用参数配置 Angular (ui.router) 的路由

c - 使用路由表查找目标地址的接口(interface)名称

laravel - 将 url 作为参数传递给路由的最佳方法

laravel - laravel 5.4 中的全外连接查询