Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...URLRewriter, IIS default document, and not using Default.aspxURLRewriter, IIS default document, and not using Default.aspx
Previous
 
Next
New Post
2/6/2006 4:44 PM
 

Today I looked more carefully at the URLRewriter code than I have in months. I learned something interesting, DNN doesn't really care what filename you use in your URL as long as theURL rewriter is executed and finds a match in the URL.

Let me give a quick example, the download page on Dotnetnuke.com is

http://www.dotnetnuke.com/tabid/125/default.aspx

But, this URL is equally effective:

http://www.dotnetnuke.com/tabid/125/bogus.aspx

Why? Because IIS sees the ASPX extension and processes the request through ASP.NET. ASP.NET first passes the request to the HTTP Module of the URLRewriter. The URLRewriter finds a match on the string "tabid". And the URL Rewriter rewrites the URL sending the request to Default.aspx.

As far as I can tell, the only time the name "Default.aspx" is really important is when you're requesting the Default document from the default directory. The request http://www.dotnetnuke.com/ works becuase the default document in the directory is set to default.aspx and there really exists a default.aspx document in that directory.

Good enough, but what do I want to really know? I want to know if I can get ASP.NET to handle the request without specifying any aspx file. Can I get IIS to send my request to ASP.NET (and to the URL Rewriter) by simply specifying

http://www.dotnetnuke.com/tabid/125/

If I could get IIS to forward this request to the URLRewriter HTTP Module, I believe we could leave off Default.aspx from the requests.  Why do I care? Of course this example is a little silly, but if you've added custom rules to SiteUrls.config you can actually make human friendly URLs in DNN (not just Search engine friendly) and leaving off default.aspx is actually a big step towards human friendlieness.

Any suggestions or input is appreciated.

 


WildVoice.com Michael Levy - Are you ready to be heard? WildVoice.com
 
New Post
2/7/2006 10:42 AM
 

I got my own answer.

I can set up a default extension script mapping as in http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx

I'm not sure I want to do this, but it is interesting to know that you can set up ASP.NET as the default handler and then use the DNN URLRewriter to map special URLs to your own pages.

I know this sounds silly, but it really has a valuable use. I am using the DNN template mechanism to create new sites. I have a template with content and I want that content to include links to its own pages. The problem is I don't know the TabIds that will be in use when the site wizard generates a new site, so you really cannot include links in templated content. The Rewriter tricks and a little redirector ASPX page let me include links to my template content without being tightly coupled to TabIDs. Trying to avoid the .aspx extension was just a way of making my link URLs human friendly.

 

 


WildVoice.com Michael Levy - Are you ready to be heard? WildVoice.com
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...URLRewriter, IIS default document, and not using Default.aspxURLRewriter, IIS default document, and not using Default.aspx


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out