Last post Sep 09, 2007 07:17 PM by rstrahl
Sep 07, 2007 12:19 AM|SilverbugNZ|LINK
I have the problem of a client who wants to do a 301 redirect for all traffic that lands on the page.
Now I've searched and searched and tested a number of code snippets which use httphandlers, but nothing seems to work. Has anyone successfully done this before?
I've heard that it cant be done from asp.net, and needs to be done in iis, but i cant even find any examples of how to do this.
Any help would really be really appreciated
urlrewrite httphandler root
Sep 08, 2007 05:07 PM|rstrahl|LINK
What's wrong with
in a handler or module?
Sep 09, 2007 02:12 PM|Clausp|LINK
Response.Redirect is a 302 temporary redirect if I remember it correctly.
Response.Status = "301 Moved Permanently";
Sep 09, 2007 05:45 PM|SilverbugNZ|LINK
Yes but how do i tell if i need to redirect or not? If i do that on the root page, its just going to start looping. I need a way of telling if they typed in the whole domain with the /default.aspx or just the domain.
Sep 09, 2007 07:17 PM|rstrahl|LINK
Not sure what you're asking. You can look at the Request.Url to determine the original Url and the URL that the redirect is supposed to go to and based on that decide on what needs to be done.
+++ Rick ---