mod_rewrite: query string gets lost on rewrite

后端 未结 2 1515
执念已碎
执念已碎 2021-01-22 18:37

I have limited .htaccess knowledge and requires some help. I need to redirect all page request to www.newdomain.com except for www.olddomain/page.json but the query string get d

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-22 19:17

    You need to add [QSA] and optionally [NE] which should give you:

    RewriteRule (.*) http://newdomain.com/$1 [QSA,NE,R=301,L]
    

提交回复
热议问题