【发布时间】:2013-07-05 09:42:21
【问题描述】:
我的 htaccess 中有以下代码
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .?- [S=2]
RewriteRule ^abc/(.*)/(.*)$ index.php?aa=$1&bb=$2 [NE,L,QSA]
RewriteRule ^abc/(.*)$ index.php?aa=$1 [NE,L,QSA]
当我通过以下网址时
http://example.com/abc/some-example?id=123
按照我的说法,我应该在 PHP 中使用 $aa = some-example 和 $id = 123
但我收到以下错误
Not Found
The requested URL /abc/[S=2] was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
当我传递如下网址时,上面的 .htaccess 文件可以正常工作
http://example.com/abc/someexample?id=123
【问题讨论】:
标签: php .htaccess url mod-rewrite http-status-code-404