我需要从mydomain.com/search.php?page=1&postcode=xxx更改网址
to:mydomain.com/search/1/xxx
我知道如何将网址从mydomain.com/search.php?page=1更改为mydomain.com/search/1 这可以通过以下方式完成:
RewriteRule ^search/([0-9]+)/?$ search.php?page=$1 [NC,L]
如何在网址中添加其他GET?
谢谢!
答案 0 :(得分:3)
这应该有效:
RewriteRule ^search/([0-9]+)/(.*)$ search.php?page=$1&postcode=$2 [NC,L]