PDA

View Full Version : Redirect Script


design4bbco
03-11-2003, 05:06 AM
Per our e-mail message, could you post a script to redirect visitors from our new URL to our old wesite address?

Thanks

bruce
03-11-2003, 05:38 AM
1) Create a file named global.asax and save it in your root directory

Put the following content in it (update the URL)

<%@ Application language="VB" %>

<script runat="server">

Sub Application_Start(Sender As Object, E As EventArgs)
' Code that runs on application startup
End Sub

Sub Application_End(Sender As Object, E As EventArgs)
' Code that runs on application shutdown
End Sub

Sub Application_Error(Sender As Object, E As EventArgs)
' Code that runs when an unhandled error occurs
End Sub

Sub Session_Start(Sender As Object, E As EventArgs)
' Code that runs when a new session is started
response.redirect("http://www.google.com")
End Sub

Sub Session_End(Sender As Object, E As EventArgs)
' Code that runs when a session ends
End Sub

</script>

2) Leave index.aspx (already in your directory) in your root directory.

Hope this helps

[b]quote:Originally posted by design4bbco

Per our e-mail message, could you post a script to redirect visitors from our new URL to our old wesite address?

Thanks
</blockquote id="quote"></font id="quote">[quote]</CODE>