Query params are getting stripped from URL
4 posts
• Page 1 of 1
- StaticMike
-
- Posts: 3
- Joined: 20 Sep 2012, 10:26
Query params are getting stripped from URL
Hi Guys,
I have a rewrite rule in place to clean up my URLs. Now we are trying to amend new params to the end. We would like these params to remain intact, but when the rewrite passes the url to IIS it drops the additional string we added.
Here is the Rule
RewriteRule ^link-details/[^/]+/(\d+)/$ /link-details.asp?lid=$1 [NC,L]
Here is the URL
http://www.staging.com/link-details/Pro ... _term=term
This is what IIS sees
/link-details.asp?lid=19383
Any help on this would be really appreciated!
Thanks!
Mike
I have a rewrite rule in place to clean up my URLs. Now we are trying to amend new params to the end. We would like these params to remain intact, but when the rewrite passes the url to IIS it drops the additional string we added.
Here is the Rule
RewriteRule ^link-details/[^/]+/(\d+)/$ /link-details.asp?lid=$1 [NC,L]
Here is the URL
http://www.staging.com/link-details/Pro ... _term=term
This is what IIS sees
/link-details.asp?lid=19383
Any help on this would be really appreciated!
Thanks!
Mike
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Query params are getting stripped from URL
hello Mike,
In case you want to preserve the querystring and add another parameter, you need to use QSA flag along with [NC,L], so it'd result in [QSA,NC,L]
Regards
Andrew
In case you want to preserve the querystring and add another parameter, you need to use QSA flag along with [NC,L], so it'd result in [QSA,NC,L]
Regards
Andrew
- StaticMike
-
- Posts: 3
- Joined: 20 Sep 2012, 10:26
Re: Query params are getting stripped from URL
Thanks Andrew! Worked perfectly.
- tidaltides
-
- Posts: 24
- Joined: 27 Nov 2012, 21:57
Re: Query params are getting stripped from URL
I agree. Same thing happened and used this fix. Thanks a lot. It worked all right.
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests