I need some clever regular expression writing in IIS7 to redirect traffic from one site to another, the pages are similar in structure but infor开发者_运维知识库mation needs re-writing.
Here's an example:
http://www.mysite.com/manufacturers/Name_of_Manufacturer_6828/Name_OF_Product_43146.htm
needs to be structured as the following
http://www.newsite.co.in/free-msds-download/name-of-manufacturer/name-of-product/
Here's what needs changing:
- Only Alpha, Numeric and hyphen's allowed.
- Change '_' to '-'.
- Remove the '_NUMBER' directly after the manufacturer name and before the '/'.
- Remove the '_NUMBER' directly after the product name and before the '.htm'.
- Remove the '.htm' and replace with a '/'.
It needs writing into the code below please as a permanent 301 redirect:
Have a look here http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/ there is some good information on how to do it here as well as examples.
精彩评论