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 dropped when it redirect. how can i preserve it? thankyou very much!
Current code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/page.json
RewriteRule (.*) http://newdomain.com/$1 [R=301,L]
Edit: Just to make it clear, i only need to stay on page.json on the old domain, lets say user request for www.olddomain.com/page1.json?session=gVgr30ExUlM i need to redirect to www.newdomain.com/page1.json?session=gVgr30ExUlM BUT when it is www.olddomain.com/page.json?=LKJHGF i need it to stay on that old domain and wont redirect is it possible?
使用[QSA]
标志(“查询字符串追加”)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.