devxlogo

Redirect More Efficiently in IIS 5

Redirect More Efficiently in IIS 5

If you are using Internet Information Server version 5, you can redirect browsers to a new page more efficiently. In IIS 4, you had to use Response.Redirect as in this snippet:

 <% If Session("loggedin") = "" Then   Response.Redirect "login.asp"  End If%>

However, IIS 5 offers the Server object’s new Transfer method. Server.Transfer is faster because it doesn’t have to send the browser the new URL. It just transfers the user without leaving the server’s request queue. Here’s how the new feature looks in code:

 <%  If Session("loggedin") = "" Then    Server.Transfer("login.asp")  End if%>
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist