We help IT Professionals succeed at work.

IIS and using the Rewrite URL problem...

I am new to URL rewite module in IIS and can not seem to get my pattern correct;
Below is the URL that needs to be rewritten:

https://www.mmm.com/JACCC/clients/clientnbr?id=123

OR it can be

https://www.mmm.com/JACKK/clients/clientnbr?id=123

Open in new window


I need to redirect it to

https:/apps.mmm.com/JAZ/clients/clientnbr?id=123

Open in new window


I am stuck:

This is as far as I got with the pattern matching:
^www.mmm.com/([a-z,A-Z])/^JAC([j,a,c,J,A,C])/^clientnbr([a-z,A-Z])/^id([0-9])

Open in new window


And my rewrite URL is

https://apps.furry.com.DogLive/client/clientnbr?id={R:1}

Could someone help me please ??
Comment
Watch Question

CERTIFIED EXPERT
Commented:
Pattern matches the path part of an URL without the leading slash, so remove the domain name part from it.
Also, AFAIK, in the regular expressions, the ^ prefix could be only inside a [] enumeration group (or marks the beginning of the line)

If you described your goal fully, the pattern could just be:
^JAC[K,C]{2}/clients/clientnbr$

Open in new window

To keep the "id" parameter, just enable the "Append query string" option

Author

Commented:
Thank you. It was confusing. But I learned a lot.  So basically, I just was to zero in on what would be the key element, in this case - JAC - for the pattern and if it has a querystring, check mark append query - kinda hard for me to explain my thoughts but I think I understand better.