I am trying to write my own 301 Redirect. I have 2 strings. One is the old url and other one is new url. The example is below
Original Url :
procurement-notice-(\d+).html
New url :
/Bids/Details/$1
like this, i have plenty of old and new url. I am doing the below to match the Urls which works fine. where the "redirect" is a dictionary contains old and new urls.
var matchedURL = redirect.SingleOrDefault(d => Regex.Match(url, d.Key, RegexOptions.Singleline).Success);
but now I want to replace the matched one with the new url.