iFinity Blogs 

Switching off all page extensions on a DotNetNuke site

May 13

Written by:
Wednesday, May 13, 2009 7:18 PM  RssIcon

It's no secret that, for a long time, I've had this site running with no page extensions - instead of having all of the pages ending with .aspx, I converted it a long time ago to /.   It's been pointed out to me several times by several people that the '/'  should actually denote part of a path, instead of the actual resource.  Deep down I agreed with this but it was harder to code : therefore confirming my long-held assertion that most programmers are actually lazy.

However, I'm happy to report that the laziness and inertia was overcome and I've refactored the Url Master code so that, when 'no page extension' is selected as an option, the paths will look like this : domain/path/path/page rather than domain/path/path/page/.  Not only that, but I've also included a 301 redirect for the '/' suffixed paths back to the plain old path.

You can see the results just by looking at the url of this very blog entry.

How you can switch off page extensions

Like what you see?  Well, you can have it as well.  Just install the Url Master software, choose 'Page Extensions : none' and click on the 'Apply Changes' button.   If you're on IIS7, that's all you need to do.  If you're on IIS6, you'll need to enable 'wildcard' extensions before you click the 'Apply Changes' button in the Url Master module.  There is instructions on the finer points of this in the Instructions Zip File : I won't repeat them here.

Terms and Privacy

In this release I decided to finally tidy up the terms/login/register and privacy inbuilt DNN Urls.  For each of these, you'll get back a simple

domain/terms, domain/privacy, domain/login and domain/register url. 

Which I think looks great.  Check out the privacy and terms links on the lower right of this site to see what you think.

Want your site Urls like this?

Normally I wait until releasing the software before announcing new features or changes like this, but I am pretty happy with the result, so I decided to blog about it before I actually released the changes.  They're in Beta testing right now, and should be available under general release in the next week or two.  Of course I'll post about that update as well, because there is more than one new feature in this next release (which will be called Url Master 1.14)  But don't hold off on getting the module now : the 1.14 release will be available to everyone who has an existing copy of Url Master.

What do you think?

Do you like extension-less sites?  Or do you prefer to show the world your asp.net origins and have the .aspx on the end?  Perhaps you like to cloak your server and change your extensions to .html or even .php.  Share via the comments below, I'm genuinely interested in what people prefer.  Me?  No extensions all the way!

 

FAQ on Switching off Page Extensions

Q: But I like my pages ending in / - I don't want to change!

A: That's OK, you can just enter '/' as your page extension, and it will work as normal. 

Q: What about the Friendly Url Provider?

A: I will update the code for the Friendly Url Provider at a later date, in line with it's next release.  You'll be able to get the same extension-less code when that release is performed.

Q: I've heard that switching on Wildcard extensions degrades site performance, is it risky?

A: It's true that switching on wildcard extensions will route all requests for all resources on your site through the asp.net runtime, and thus through many of the DNN modules.  This has the potential to degrade performance, but to what degree I've never tested.  My philosophy is : hardware is cheap - throw CPU at the problem.  This site runs on a fairly small VPS and I'm happy with the performance.  Test it out and make up your own mind.  Incidentally, you can switch on wildcard extensions without changing your site Url scheme : so you can switch on the wildcard, monitor your performance and then decided whether or not to go extension-less.

Tags:
Categories:
Location: Blogs Parent Separator Crafty Code

12 comment(s) so far...


Gravatar

Re: Switching off all page extensions on a DotNetNuke site

Hmm - I actually prefer the extension, but this is purely personal preference. I think I am just used to seeing it on the end of a URL (regardless if it is php/asp etc.) It does look very neat though without it...
I'd love to see some stats across the top 100 websites in the world and what the averages are - I see Facebook still keeps the .php on the end. I think after reading your comments that there MIGHT be a performance risk I'll keep them on for now. I like the look of the Terms/Privacy - I am running the 1.14 beta on the PokerDIY test site but I see it has not changed - how do I enable this?

By Smart-Thinker on   Wednesday, May 13, 2009 9:45 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

@rodney the terms/privacy links should be automatic. Check to see you haven't hard-coded them into your skin. Facebook, ebay et al all are legacy apps : I imagine that nobody could make a business case for removing the extensions on those particular sites. Ebay takes the prize for the ugliest and most difficult urls known to the internet. Google, Twitter and Wikipedia all run extension-less sites, if it's any help to your thought process.

By Bruce Chapman on   Wednesday, May 13, 2009 10:15 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

Hi Bruce,
Great work! Even with the performance hit, I prefer extension-less urls. I think it makes the url cleaner, and easier to remember for users. I'm really looking forward to the refactoring of the terms/privacy links Have you also gotten RSS syndication resolved when running under extension-less urls? If I recall correctly it was an issue 1.12?

By Scott Allender on   Thursday, May 14, 2009 5:26 AM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

@scott : No I haven't solved the core RSS syndication problems, if you're talking about the problem I'm thinking of. While I do have an idea of how to do this, I need to rework the interface to allow more page-level settings. This is something I am working on for the longer-term, to allow better page and portal-level configurations. Essentially to fix the RSS problem the Url will need to be identified as an RSS Url to-be and processed in a particular way on the friendly url side of things. Bottom line: not fixed yet.

By Bruce Chapman on   Thursday, May 14, 2009 3:52 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

What if I already have a custom page domain/register.aspx with a custom registration module on it?

Also, this performance hit for wildcard extensions is it for iis6 only or for iis7 too?

Thanks.

By Ivan on   Friday, May 29, 2009 9:28 AM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

@ivan I haven't done any actual research into it, but in general, yes, it will take more resources to serve up content if all the extension-less urls are being parsed through the asp.net/dnn http modules etc. However, I still maintain that for most sites, the performance difference will be so small to be virtually undetectable. The way it works in IIS7 is that the 'runAllModulesForAllRequests' flag is set to 'true' on the HttpModules section, which means that every request for a resource on the site will run through each of the httpModules. Generally this is not a problem but it will take more cpu cycles, obviously.

By Bruce Chapman on   Friday, May 29, 2009 12:34 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

Bruce, thanks. I may go with it - they look better especially that now you have removed the "/".

What about this default domain/register page? I already have a custom page that is domain/register - isn't this going to create a conflict?

By Ivan on   Friday, May 29, 2009 9:22 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

Hi Bruce,
Is it possible to have fully extension-less URLs with the Friendly URL Provider?

By Laurence on   Saturday, July 04, 2009 2:57 AM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

@laurence : not yet. I will need to do another release of the Friendly Url Provider with this functionality. At this stage, it won't be for a couple of weeks.

By Bruce Chapman on   Saturday, July 04, 2009 7:54 AM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

Hi Bruce,
Is this available with the Friendly URL Provider now? Thanks

By Graham on   Friday, October 09, 2009 9:49 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

@Graham : yes, the latest release of the friendly url provider will do the same full extension less urls.

By Bruce Chapman on   Friday, October 09, 2009 10:13 PM
Gravatar

Re: Switching off all page extensions on a DotNetNuke site

Hi Bruce,

I am using ActiveSocial and trying to enable their Group Vanity URLs (it requires a HTTPhandler in the web.config). I am getting an error in the AS handler ([NullReferenceException: Object reference not set to an instance of an object.]
DotNetNuke.Entities.Portals.PortalSettings)

Do you know if ActiveSocial plays nicely with UM with extensionless URLs?

Just for the record - I was also testing the PageBlaster Static Image Handler with extensionless URLs (you have to put image file mappings to go through the PB handler) - it still seems to add the expire cache value (which is good for the page speed).

By Rodney Joyce on   Tuesday, June 15, 2010 2:25 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel