Saturday, 7 September 2013

Rewrite URL in web.config but disregard query string

Rewrite URL in web.config but disregard query string

purgent problem here./p pI have the following rewrite rule in web.config/p
precodelt;rewrite url=~/product/(.+)
to=~/outbound-link-proxy.aspx?product=$1 /gt; /code/pre pThis should
rewrite (e.g.)/p precodemydomain.com/product/car /code/pre pto/p
precodemydomain.com/outbound-link-proxy.aspx?product=car /code/pre pThis
is working fine. However I have noticed that some sites are linking to
mine and adding their own query string on the end. I don't mind this but
it is breaking my rewrite./p
precodemydomain.com/product/car?foreignQueryString=983249 /code/pre pCan
anyone help me with the rewrite rule to preserve my original rewrite but
disregard any query strings so that /p
precodemydomain.com/product/car?foreignQueryString=983249 /code/pre pstill
rewrites to/p precodemydomain.com/outbound-link-proxy.aspx?product=car
/code/pre
pAny help appreciated/p

No comments:

Post a Comment