URL Rewrite rule for IIS to replace folder path in everypage

后端 未结 3 419
死守一世寂寞
死守一世寂寞 2021-02-04 13:08

We are having more than 300 pages in my website project. Over the time we have created a new server which is secure. This server is specially used for all the images in website.

3条回答
  •  悲&欢浪女
    2021-02-04 13:31

    You need to create Outbound Rule in IIS. Rule will need following:

    1. Precondition should only check html files (I used default IsHTML)
    2. In "Matching the content with" choose elements in which you would like to check links
    3. Pattern is ^(.*)/assets/(.*)
    4. Action properties is http://static.mysite.com/{R:2}. R:2 reffers to second () in above regular expression. You could check what you need after click of "Test pattern" button.

    Bellow simple rule which meets above:

    enter image description here

提交回复
热议问题