laravel - 为什么 Apache(centos 7) 看不到我创建的路由?
问题描述
我做了路由,但是 apache 服务器看不到那个路由。Laravel 欢迎页面没有问题,但是当我尝试在视图中创建另一个文件夹时。Apache 看不到该页面。404 未找到弹出。
这是路线和控制器代码
Route::get('/pages', 'Pages@index');
和控制器
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>
推荐阅读
- javascript - Vue 3 组合 API 和对 Vue 实例的访问
- powershell - Powershell - 从文本文件中删除特定单词
- c++ - _mm_xor_pd 失败,产品 = 0
- ms-access - 如何组合2个access数据库表
- node.js - 如何在MongoDB数据库中回滚?
- c# - 从所有表中选择整个数据库的名称
- c# - bcp 永久保存 csv 文件,并且在从 c#.net 网站调用时不会将表中的任何内容写回 CSV
- selenium - 由于 selenium.WebDriverException,无法定向到 Microsoft Edge 中的页面:无法解析远程响应:未知错误
- python - 使用 df.loc[] 根据另一个为空的列值更新数据框列值
- android - 用于长期通知的 AlarmManager - 它有效