这是我到目前为止所尝试的:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L]
RewriteCond %{QUERY_STRING} ^id=([0-9]{1})$
RewriteRule ^article\.php$ /article/%1 [L]
基本上,第一组规则将 URL 从 something.php 转换为 something。
第二组规则应该将其中包含 article.php?id=NUMBER 的任何内容替换为 /article/NUMBER。
阿帕奇报告:
AH00124: Request exceeded the limit of 10 internal redirects due to probable
configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary.