14
Dec
07

301 Redirects for ASP.NET

I’ve had a lot of trouble finding code to do a 301 redirect in .NET, but I finally found some that works, courtesy of Keyvan.

<script runat=”server”>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Response.Status = “301 Moved Permanently”
Response.AddHeader(“Location”, “http://www.mwi.com/”)
End Sub
</script>


I don’t pretend to understand every bit of the code, but what I do know is that I pasted it as you see it above into a .net page and it worked.


1 Response to “301 Redirects for ASP.NET”


  1. 1 Popular Generics Sep 9th, 2011 at 6:23 am

    I am really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the excellent quality writing, it’s rare to see a great blog like this one these days..

Leave a Reply




local business directories

Linkage