[英]RewriteRule does not match if there is no /
以下RewriteRule
將匹配:
http://example/test/article/1
並且
http://example/test/article/
但不是這個:
http://example/test/article
(如果URL末尾有斜杠)
如果沒有結尾/
后article
那么我得到內部服務器錯誤 。
規則:
RewriteRule ^([^\.]+)/article/ $1-article.php?id=$2 [NC,L]
即使article
之后沒有斜杠, 如何更改上述RewriteRule以匹配。
采用:
RewriteRule ^([^\.]+)/article/? $1-article.php?id=$2 [NC,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.