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