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...How does default.aspx work?How does default.aspx work?
Previous
 
Next
New Post
6/16/2008 3:21 PM
 

While I understand that setting the IIS website properties to have default documents allows the following to work:

http://localhost/DotNetNuke/

http://localhost/DotNetNuke/default.aspx

I don't understand how it allows the following to work:

http://localhost/dotnetnuke/Host/Host%20Settings/tabid/16/portalid/0/Default.aspx

http://localhost/dotnetnuke/Admin/SiteSettings/tabid/39/Default.aspx

etc.

My reading of the IIS documentatation implies that default.aspx would also have to reside in all the subdirectores such as

/dotnetnuke/Host/Host Settings/tabid/16/portalid/0/

/dotnetnuke/Admin/SiteSettings/tabid/39/

which needles to say don't exist.  When I've tried create a simple website that hosts only default.html and has a couple of sub directories, it in fact requires that default.html exist in every directory for it to work.

In Java application servers, there is an ability to tell the server to match up to a certain portion of the url, e.g. "/dotnetnuke" in this case, and then hand the request to the association application.  But for the life of me I can't find similar capabilities in iis.

So what am I missing?

Jerome Dayton

 

 

 
New Post
6/16/2008 4:06 PM
 

By default DNN uses “friendly URLs”, this essentially overwrites the urls to make them more SEO and human friendly. The URLs DNN generates do not physically exist, they are intercepted at the ASP.NET application level and are decoded to serve correct pages to the end user. The Default.aspx page is essentially a container with in which the actual DNN framework is invoked. Typically the medial, css, and javascript content should be stored in the /portals/[PortalID] folder (replace [PortalID] with the actual numeric portal number generated by DNN). In the Path references with in Text/HTML module use relative path such as /portals/[PoratlID]/myscript.js to load your custom script files and other media.


Affordable DotNetNuke Hosting Affordable DNN Hosting & Support - www.ihostasp.net
Slavic Kozyuk
IHOST, LLC
Call toll-free: 1.800.593.0238
 
New Post
6/16/2008 4:16 PM
 

Hi Jerome,

Just to elaborate a bit on Slavic's response, DotNetNuke accomplishes this magic through the use of HttpModules.  If you look in your web.config, you'll see, under configuration/system.web/httpModules the following entry:

<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" />

You'll definitely want to read up on httpModules, but essentially each registered module has the opportunity to handle EVERY request that his the ASP.NET process (which includes nonexistant .aspx pages, but not by default .html or .gif pages).

So even for a nonexistent url such as http://localhost/dotnetnuke/tabid/39/Default.aspx, this httpmodule will get a chance to process the request.

That's the first piece of the puzzle.  The second piece is how the httpModule converts the request to a usable one.  This is essentially executed by converting the intermediate url tokens to querystring parameters.

So the above url is converted by the httpModule code to: http://localhost/dotnetnuke/Default.aspx?TabId=39.  Once the httpModule has performed this conversion, the URL is passed off for "normal" handling.

The converted url does exist at /localhost/dotnetnuke/Default.aspx, and is henceforth handled normally.  DNN picks up the desired TabId via querystring.

Naturally I've simplified things a bit, but this is the essence of what goes on behind the scenes.

Hope this helps!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
6/16/2008 4:40 PM
 

So the magic is in the HttpModules!!!   Thanks guys, I new it had to be somewhere!

Jerome Dayton

 
New Post
6/16/2008 4:49 PM
 

No problem Jerome, glad we could help.  For more details, download the DNN source package and look at /Library/HttpModules/UrlRewrite/UrlRewriteModule.vb.  Most of the action occurs in the OnBeginRequest method.

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How does default.aspx work?How does default.aspx work?


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