更新时间:2023-02-24 10:37:11
代替:
RewriteRule ^sub/file/([0-9]+)/?$ sub/file?num=$1 [L]
试试:
RewriteRule ^sub/file/([0-9]+)/?$ /sub/file.php?num=$1 [L]
[L]
将停止处理规则是正确的,但这也意味着您不能消除 .php 扩展名,因为它的规则低于此规则.还要注意前导斜杠.
You're correct that [L]
will stop processing rules, but that also means that you can't eliminate the .php extension since the rule for that is below this one. Also note the leading slash.