开发者

URL ReWritting rule for my url

开发者 https://www.devze.com 2023-04-04 00:07 出处:网络
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.

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:

  1. Only Alpha, Numeric and hyphen's allowed.
  2. Change '_' to '-'.
  3. Remove the '_NUMBER' directly after the manufacturer name and before the '/'.
  4. Remove the '_NUMBER' directly after the product name and before the '.htm'.
  5. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消