mod_rewrite: query string gets lost on rewrite

后端 未结 2 1486
执念已碎
执念已碎 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]
    
    0 讨论(0)
  • 2021-01-22 19:18

    Use the [QSA] flag ("query string append")

    0 讨论(0)
提交回复
热议问题