V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
frozenway
V2EX  ›  问与答

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

  •  
  •   frozenway · 2018-08-07 14:10:17 +08:00 · 897 次点击
    这是一个创建于 2060 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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
    

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

    1 条回复    2018-08-07 14:14:22 +08:00
    frozenway
        1
    frozenway  
    OP
       2018-08-07 14:14:22 +08:00
    也就是说访问 http://www.local.com/api/index.html 时,根本没重定向到根目录的 index.php 里面
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5288 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:27 · PVG 09:27 · LAX 18:27 · JFK 21:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.