抱歉标题不好。
我有以下我认为非常简单的规则:
RewriteRule ^(blog|articles|other)(/?)$ articles/?type=$1
然后我点击
www.mysite.com/other
但是页面越来越 ?type 作为“文章”?!
在这里插入我挠头的照片。
最佳答案
您的规则将导致无限循环。用这个替换你的代码:
RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteRule ^(blog|articles|other)(/?)$ articles/?type=$1 [L,QSA,NC]
由于目标 URI 也是
/articles/
这将一次又一次地匹配条件模式,直到 Apache 用完 RewriteLimit 并抛出 500。
关于mod-rewrite - 重写不起作用(匹配多个),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18775218/