HttpRedirect in Web. config-redirect individual pages

Source: Internet
Author: User

Cases:
In the following example, the directory contains page1.htm,page2.htm,page3.htm and page4.htm. The Web. config file, as shown below, will perform the following actions
/pages/page1.htm will redirect to/newpages/newpage.htm
/pages/page2.htm will redirect to Google
/pages/page3.htm will redirect to specific pages of Yahoo!

<? xml version = "1.0" ?> < configuration >      < location path = "page1.htm" >          < system.webServer >              < httpRedirect enabled = "true" destination = "http://www.victor-ratajczyk.com/examples/webconfig/redir/newpages/newpage.htm" httpResponseStatus = "Permanent" />          </ system.webServer >      </ location >      < location path = "page2.htm" >          < system.webServer >              < httpRedirect enabled = "true" destination = "http://www.google.com" httpResponseStatus = "Permanent" />          </ system.webServer >      </ location >      < location path = "page3.htm" >          < system.webServer >              < httpRedirect enabled = "true" destination = "http://news.yahoo.com/science/" httpResponseStatus = "Permanent" />          </ system.webServer >      </ location > </ configuration >

HttpRedirect in Web. config-redirect individual pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.