我正在使用 PHP codeigniter 和 chriskacerguis/codeigniter-restserver。
在日志文件中,我看到 404。因为/index是如何在末尾追加的。正确的 url 是api/CurrentYear
DEBUG - 2016-02-02 02:14:48 --> UTF-8 Support Enabled
DEBUG - 2016-02-02 02:14:48 --> Global POST, GET and COOKIE data sanitized
ERROR - 2016-02-02 02:14:48 --> 404 Page Not Found: api/CurrentYear/index
任何人都可以告诉我为什么 /index 会在末尾追加或任何解决方案。
我的 .htaccess 看起来像这样。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>