I am encountering an unexpected behavior:
The following statement works fine:
Context.RewritePath( "~/Default.aspx" ); // redirect to default doc, explicitly
This gives me a 404 error:
Context.RewritePath( "~/" ); // redirect to default doc, implicitly
Loading document /
from a browser without doing any URL rewriting correctly loads the document, so I figure IIS is correctly configured, and that /
and /Default.aspx
indeed refer to the same document.
I would rather use the latter statement, as there is a possibility that the Default document name will be changed in IIS as time goes on. I'm assuming the solution involves some method to retrieve the Default Document name from IIS, however I've been unable to locate such a method.
So my question is: What is the correct way to specify a default document when rewriting the URL?