![](/img/trans.png)
[英].htaccess multi RewriteRule and RewriteCond help me to combine them together
[英]Help me write a Regex RewriteRule for htaccess
我需要幫助為htaccess中的mod_rewrite為RewriteRule編寫一個簡單的正則表達式。 因此,這是我要完成的工作:
books/2010-the-world-by-hopkins-139_PPS-1234567
應該去
index.php?pagename=mypage&PPS=1234567&description=2010-the-world-by-hopkins-139
因此,在pseducode中,正則表達式必須將books
后的部分用_
分隔,我應該將其分為兩部分:
_PPS-
之后的部分 _
之前包含任何內容的部分。 我想RewriteRule會像這樣:
RewriteRule books/(.*)_(.*) index.php?pagename=mypage&PPS=$2&description=$1
但是我需要正確的正則表達式。 請幫助。
像這樣:但是翻轉$ 1和$ 2;)
^books/(.*)_PPS-([0-9]{1,})$
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.