tags:

views:

149

answers:

3

I'm attempting to issue a 301 redirect when a user requests http://www.mysite.com/Default.aspx to http://www.mysite.com/

The issue I'm having is that every property I can find within Request (Request.Url, Request.RawUrl, etc) is identical for those two requests.

Edit for further clarification: This is on a shared web host, I can't install ISAPI extensions.

One more edit. Apparently the first tech support guy I talked to at the host didn't know what he was talking about, they have ISAPI rewrite installed.

+1  A: 

Just use a url rewriting ISAPI filter. It's painless. This page on Scott Gu's blog contains pretty much all the info you need.

mattRo55
I don't have access to add that filter, its a website on a shared host.
Matt
@Matt Ross: are you sure that the IIS mechanism for trying to resolve the default document by passes URL rewriting ISAPI filter? If not you have an infinite loop.
AnthonyWJones
The isapi filter would work, I've used it on other servers. Its just this one that I'm stuck on that won't let me add any.
Matt
+2  A: 

Steve Wortham's Blog describes how he addressed the same issue.

He used Ionic's free Isapi Rewrite Filter

dommer
+1. The blog gives a good reason why someone would want to do this.
AnthonyWJones
I can't add ISAPI filters, see edit on post.
Matt
A: 
Zhaph - Ben Duguid
I'd call it a knee jerk response - any time the same content is available in multiple places, I'd consider it at the very least redundant and worth cleaning up.And yes, SE's are generally brighter, but why make their job harder than necessary?
Matt
You'll also want to handle casing then ;)
Zhaph - Ben Duguid