Apache 如何使用.htaccess替换请求参数名称?
我想重写部分URL,如:Apache 如何使用.htaccess替换请求参数名称?,apache,.htaccess,Apache,.htaccess,我想重写部分URL,如: /api/posts?topic.id=246&pagination=false 到 topic.id=>postTopics.topic.id 请帮助。是否topic.id始终为整数?是,topic.id始终为整数是topic.id始终为整数是,topic.id始终为整数 RewriteEngine on RewriteCond %{QUERY_STRING} !postTopics.topic.id= RewriteCond %{QUERY_STRING}
/api/posts?topic.id=246&pagination=false
到
topic.id=>postTopics.topic.id
请帮助。是否
topic.id
始终为整数?是,topic.id
始终为整数是topic.id
始终为整数是,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]
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]