mackaboogie
asked on
Need regex for IIS URL rewrite
I have to write a URL re-write using the IIS7 url rewrite tool.
My original URL looks like /events/A-New-Site-OOO.htm ?promotion =3036
I need the to be able to create the back references for each part...
$1 = events
$2 = A-New-Site-OOO
$3 = promotion=3036
$2 should be able to handle hyphens
$3 should be everything after the ? or the original query string
My original URL looks like /events/A-New-Site-OOO.htm
I need the to be able to create the back references for each part...
$1 = events
$2 = A-New-Site-OOO
$3 = promotion=3036
$2 should be able to handle hyphens
$3 should be everything after the ? or the original query string
Try:
^([-A-Za-z0-9]+)/([^/]+)[^ /]*\?(.*)$
^([-A-Za-z0-9]+)/([^/]+)[^
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What if you did:
([^/]+)/([^.]+)[^?]+\?(.*)
ASKER
I started with something like this:
^([-A-Za-z0-9]+)/([^/]+)(\
What it gives me is the following..
$1 = events
$2 = A-New-Site-OOO
$3 = .htm?promotion=3036
so I am pretty close...