Reputation: 31
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?
Upvotes: 3
Views: 1533