Redirecting The Browser

Sometimes it is necessary to force a browser to a different page. This can be accomplished with a re-direct. Much like the Response.Write command that was used earlier, a Response.Redirect will point a browser to a new URL. The code looks like this:

<% response.redirect "http://homepages.findlay.edu/trusty/565" %>

How could this be useful? Suppose you have a "development" site, and while a project is being created, all the traffic is going to the "test" site. At some point, the project is finished, and moved to the "main" web server. Unfortunately, browser habits can be hard to break, so many people continue to go to the "development" site. If you take the "test" site off-line, some people may not be able to find the final project. With a re-direct, the browser can be automatically taken to the new site.

I have done this on the University servers. Until the new homepages.findlay.edu server went online, I used the main web server to store my web pages. Once the new server went online, I wanted everyone to come to the new site, because I am no longer updating information on the old site.

I used to have a web page on an older server. When I moved my pages over to the UF Homepages server, I didn't want to tell everyone about my new server address. On the old server, I create a redirect to the new server. My old web page has this line at the top.

<% response.redirect "http://homepages.findlay.edu/trusty" %>

Now anyone visiting the old site is automatically re-directed to the new site. Try it for yourself.

http://www.trustyetc.com/trusty

When this page opens, what is your URL?

Cascading Style Sheets

Home - Server Side Include - Dynamic Text - Rotating Graphics - Re-Direct - CSS