IIS Help

A client asked me if i can set the web server so that the default page is .aspx . So we don't have to specify the extensions when providing links to pages in documents.

example...
So that when a user can type in a URL like www.mydomain.com\HR . If there is a .aspx page called "HR" the server defaults to the .aspx extension.

how do i do this?

please help!


hiren
 
We tried to upgrade you to 8.1 without success so... we are still working on that, so here are the docs for 7.5.6 that you are on:

Managing Web Directories

Of note the section you need is the "default documents search order"
 
oh I got it now, you will be best since this is an asp.net site to use a .net based rewrite engine for this, DotNetNuke includes such and engine and I velieve there are other free ones out there as well.
 
it can be done with IIS rewrite engines, or in code redirects. you could make an error page that intelligently direct based on name and assign it to all non existant pages :)
 
I don't think you can do it simply with a .NET http module which is what asp.net rewrite engines are. The problem is that the request never gets into the asp.net pipeline because the url doesn't have a .aspx extension.

I think the custom error page as Stephen suggests can work although its kind of kludgey.

If you only need this for a few top level URLs then perhaps a cleaner way is to create a folder of the same name and place a default page in that folder which does either a http redirect or, if its asp.net (ie the page is Default.aspx) then do a Server.Transfer. With the http redirect, you'll have to redirect the browser to the aspx url but with Server.Transfer you'll be able to do it transparently so the url doesn't change. Its probably possible to write a generic Default.aspx to do this that doesn't need to be customized, ie it knows its own url, assumes you want to append .aspx and then does a Server.Transfer.

Cheers
Ross
 
Back
Top