【发布时间】:2018-04-05 00:32:23
【问题描述】:
我已经尝试了很多教程,在stackoverflow和其他网站上搜索和研究,但我仍然无法解决这个问题。 这是它。 这是我的文件夹结构以及 .htaccess 和 index.php 文件:
file structure | .htaccess | index.php
当我尝试访问内置服务器的 php (sudo php -S localhost:800) 时,我得到了这个:
使用 apache2 时,我得到如下文件夹结构:
我也尝试将 DirectoryIndex 更改为 public/index.php,但是在键入查询字符串时(SEO 友好,使用斜杠而不是 ex.:?a=2)我收到错误,服务器显示例如:
在此服务器上找不到请求的资源 /mvc-oop/home/id/2。
【问题讨论】:
标签: php apache .htaccess mod-rewrite model-view-controller