我的 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
按照我的说法$aa = some-example
,我应该$id = 123
使用 PHP
但我收到以下错误
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