Register   Login
     
  Categories  
  Archives  
  Authors  
  Blog  
10

Last night, I posted a blog entry showing some of the real friendly URL functionality I have been working working on.

Immediately, there were some comments, and I'd like to address some of those here.

Excellent Scott. How's it handle page names being the same (e.g. Say there a page called Humans under both the Races and Classes)?

Great question, both urls would look like:-

  • friendly.ventrian.com/races/humans.aspx
  • friendly.ventrian.com/classes/humans.aspx

To understand why the above would be OK, we must first understand how the rewriter works.

The first goal of the rewriter is to identify the portal we are working with. To do this, it breaks up the URL and begins to test for a valid portal alias, so the list of tests would be as follows:-

  • friendly.ventrian.com (Portal alias found, stop looking!)

If a portal alias wasn't found, it would keep looking as follows:-

  • friendly.ventrian.com (Portal Alias not found, keep looking down a folder)
  • friendly.ventrian.com/races (Portal Alias not found, keep looking down a folder)

We are out of folders now, so panic and just call the old rewriter to do its work.

The second goal of the rewriter is to identify the page we are working with. To do this, lets look at what is left over from the following url.

  • friendly.ventrian.com/races/humans.aspx

The portal alias we already know, (friendly.ventrian.com). The left over part is races/humans.aspx.  Now we have the left over part, loop through the list of pages in the portal, and look at the tabPath variable. The tabPath variable stores the path back to home, in our case, it stores //races//humans. So with a bit of manipulation, we can find a match and retrieve the tabID so we can serve up the page.

If the page is not found in the portal, it keeps looking down the folder structures for further portals (possibly child portals with a matching tabpath).

So its for this reason, the following would work:-

  • friendly.ventrian.com/races/humans.aspx
  • friendly.ventrian.com/classes/humans.aspx

However, the following would not work (if there were 2 pages called humans.aspx under races).

  • friendly.ventrian.com/races/humans.aspx
  • friendly.ventrian.com/races/humans.aspx

The first page found in the list of pages within a portal would get returned each time, rather then the unique instance. We can add error checking for this later.

I noticed that it does not allow 'friendly' parameters so you could have http://friendly.ventrian.com/Races/Dwarves.aspx but not http://friendly.ventrian.com/Races/Dwarves.aspx?AlbumID=367-1
or
http://friendly.ventrian.com/AlbumID/367-1/Dwarves.aspx

Currently, it does not do this as you have found out. But I am looking to get it working with an enhancement. If you read the above question, I would need to take the parameters out of the url, and then look at the tabpath of what is left. It should be achievable.

Now for my own question, can you have multiple urls point to the same page?

I'm glad you asked that, the next enhancement I am making will allow you to add additional urls to a page to make it resolve. (Kind of like how portal alias's work for a portal). So when resolving a url, it would look at this map of pages first, then the tabpath, then call the old rewriter if it still can't find anything.

Posted in: DotNetNuke Core

Comments

koskimaki
# koskimaki
Wednesday, January 11, 2006 8:57 PM
This is great! It is a big help to SEO. Would this also work with child portals as below?

mysite com/child1/forums.aspx

And if it does, could you use this to prevent it from redirecting child portals when initially loaded (an annoying side affect) as shown below?

mysite com/Default.aspx?alias=mysite.com/child1

so that it would be mysite com/child1 instead?
smcculloch
# smcculloch
Thursday, January 12, 2006 3:05 AM
Another great question, I haven't tested that scenario yet, but it is one of my goals to get around that first redirect.
Anonymous
# Anonymous
Sunday, January 15, 2006 12:26 PM
The BIG question, when will we see the enhancments? :)

also, all the best in the newcoming marrige :)
CasperJuna
# CasperJuna
Monday, January 23, 2006 5:27 AM
You're probably way too busy preparing your own wedding, but is there any chance we can see your code for this improvement? This is definately the way to go!
Anonymous
# Anonymous
Monday, January 30, 2006 2:36 PM
Scott... what about the paths to pages that are beneath hidden menu structures?

e.g. mysite.com/hidden/innerpage.aspx
Anonymous
# Anonymous
Tuesday, February 28, 2006 10:59 PM
Scott, will this provider be released as part of the core, and when can we expect it if it will?
yukor2
# yukor2
Wednesday, April 12, 2006 8:55 AM
Any new information on "Really friendly URLs"? I would love to see something like this available in the core or as an add-on. Thanks.

Post Comment

Name (required)

Email (required)

Website

Enter the code shown above: