簡體   English   中英

如果沒有/則RewriteRule不匹配

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM