MAMP / Slim PHP 仍然有 404 错误
MAMP / Slim PHP still have 404 error
我正在使用 MAMP PRO 和 Slim PHP 框架。
这是我的项目结构:
- htdocs
- 我的应用程序
- api
- index.php
- .htaccess
我的.htaccess :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
如果我尝试使用 Postman 发送 GET 请求:
localhost:8888/管理员
我在 apache 日志中收到 404 和此错误:
[错误] [客户端::1] 文件不存在:/Applications/MAMP/htdocs/admin
但是有了这个:
localhost:8888/myapp/api/index.php/admin
有效...
我想就此 url 提出我的要求:
localhost:8888/管理员
我尝试了很多东西... RewriteBase,配置 VirtualHost,...
你能帮帮我吗?
在 Apache 配置中将您的文档根目录设置为 /Applications/MAMP/htdocs/myapp/api
。
我正在使用 MAMP PRO 和 Slim PHP 框架。 这是我的项目结构:
- htdocs
- 我的应用程序
- api
- index.php
- .htaccess
- api
- 我的应用程序
我的.htaccess :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
如果我尝试使用 Postman 发送 GET 请求: localhost:8888/管理员 我在 apache 日志中收到 404 和此错误: [错误] [客户端::1] 文件不存在:/Applications/MAMP/htdocs/admin 但是有了这个: localhost:8888/myapp/api/index.php/admin 有效...
我想就此 url 提出我的要求: localhost:8888/管理员
我尝试了很多东西... RewriteBase,配置 VirtualHost,... 你能帮帮我吗?
在 Apache 配置中将您的文档根目录设置为 /Applications/MAMP/htdocs/myapp/api
。