Link to home
Start Free TrialLog in
Avatar of Randy Johnson
Randy JohnsonFlag for United States of America

asked on

IIS rewrite issue. I cannot get the query_string to match

What is wrong with this IIS rewrite rule?  I cannot seem to get it to work. If I remove the query string condition it works as expected.

<rule name="Rule 495" stopProcessing="true">
				<match url="^golfbooking/golfbook.aspx$" ignoreCase="true" />
				<conditions>
				<add input="{QUERY_STRING}" pattern="PackName=Tee+Times+Only&amp;PackNew=TRUE&amp;hdr=pmb" />
				</conditions>
				<action type="Redirect" url="https://www.mbgolf.com/golfbooking/teetimesonly.htm" redirectType="Permanent" />
				</rule>

Open in new window

Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

If you are only looking for this exact query string on the golfbook.aspx page, you could try an exact match rule:

<rule name="Tee Time Only" patternSyntax="ExactMatch">
    <match url="golfbooking/golfbook.aspx?PackName=Tee+Times+Only&amp;PackNew=TRUE&amp;hdr=pmb" />
    <action type="Rewrite" url="https://www.mbgolf.com/golfbooking/teetimesonly.htm" appendQueryString="false" redirectType="Permanent" />
</rule>

Open in new window


If there additional query string variable attached to the request, you will have to account for those as well.

Dan
Avatar of Randy Johnson

ASKER

That doesn't work.  Something with that query string has to be causing an issue...
ASKER CERTIFIED SOLUTION
Avatar of Randy Johnson
Randy Johnson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ah, I didn't even think of that.  Good catch.
This was the solution that I implemented