关于 Apache 的一个很很很奇怪的问题

2018-08-07 14:10:17 +08:00
 frozenway

apache 版本 2.4.27 。项目是某 Thinkphp 框架,框架根目录有个.htaccess 文件

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

这意思大概是所有的访问都指向 index.php.但是我在访问 http://www.local.com/home/api/index.html 时是正常的,但是访问 http://www.local.com/api/index.html 时却显示

Not Found
The requested URL /api/index.html was not found on this server.

Apache/2.4.27 (Win64) PHP/5.6.31 Server at www.local.com Port 80

这似乎有点诡异,有谁知道这是什么情况?

928 次点击
所在节点    问与答
1 条回复
frozenway
2018-08-07 14:14:22 +08:00
也就是说访问 http://www.local.com/api/index.html 时,根本没重定向到根目录的 index.php 里面

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/477597

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX