我想重写部分网址,例如:
/api/posts?topic.id=246&pagination=false
自
/api/posts?postTopics.topic.id=246&pagination=false
topic.id => postTopics.topic.id
请帮忙。
RewriteEngine on
RewriteCond %{QUERY_STRING} !postTopics.topic.id=
RewriteCond %{QUERY_STRING} ^(.*)topic.id=([0-9]*)(.*)$
RewriteRule ^ %{REQUEST_URI}?%1postTopics.topic.id=%2%3 [QSD,NE]