Query params are getting stripped from URL

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 20 Sep 2012, 10:26

Query params are getting stripped from URL

20 Sep 2012, 10:39

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

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Query params are getting stripped from URL

20 Sep 2012, 11:01

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

User avatar
Posts: 3
Joined: 20 Sep 2012, 10:26

Re: Query params are getting stripped from URL

20 Sep 2012, 11:24

Thanks Andrew! Worked perfectly.

User avatar
Posts: 24
Joined: 27 Nov 2012, 21:57

Re: Query params are getting stripped from URL

29 Nov 2012, 23:59

I agree. Same thing happened and used this fix. Thanks a lot. It worked all right.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 7 guests