我在 IIS 中导入了这些重写规则:
RewriteRule ^search/(.+)/([0-9]+)?$ search.html?name=$1&page=$2 [QSA,L]
RewriteRule ^search/(.+)?$ search.html?name=$1&page=1 [QSA,L]
翻译是:
match url="^search/(.+)/([0-9]+)?$" ignoreCase="false"
action type="Rewrite" url="search.html?name={R:1}&page={R:2}" appendQueryString="true"
match url="^search/(.+)?$" ignoreCase="false"
action type="Rewrite" url="search.html?name={R:1}&page=1" appendQueryString="true"
但是当我测试时不起作用
HTTP 错误 404.0 - 未找到 - 这是错误