DevWebProFrance News Archives About Us Feedback
Sign Up For adCenter - Get $50 In Free* Clicks.

Web News

Air France launches in-flight cell phone trial
Air France launched a commercial trial of an onboard cell phone service, but in a limited fashion that avoids a controversial aspect. Travelers on certain Air...

4 Million Nintendo DS Systems Sold in France
The Nintendo DS continues to post impressive sales worldwide, and now the handheld video game player has surpassed four million units sold in France alone...

Thales in talks to sell e-Transactions to Hypercom
French electronics group Thales said on Thursday it had entered in exclusive talks with Hypercom to sell its e-Transactions business for $120 million in cash.

Europe 2 TV and radio to be rebranded Virgin
Lagardere SCA, France's largest publisher, will rebrand its Europe 2 radio and television stations with the Virgin name and will pay a licence fee to billionaire Richard Branson's Virgin Group Ltd. Lagardere will pay a fee...



Recent WebProNews Articles

Clinton Set To Launch Sites Attacking Obama
The campaign of Senator Hillary Clinton, D-N.Y. is set to launch two Web sites that will be focused on attacking her biggest political threat, Senator Barack Obama...

Former Googler Goes To LiveJournal
By this time of year, many ponds have frozen over, but we'll still use the analogy: is it better to be a big fish in a small amount of water or an average-sized fish in a lot of the stuff? Jason Shellen seems to prefer the first...

EU Worried About Privacy With Google, DoubleClick
Privacy a bigger deal to Europe than to the FTC. European Commission regulators reviewing the Google-DoubleClick deal have heard concerns from...

Online Holiday Shoppers Having Positive Experience
Nielsen Online Reports 82% Are Satisfied. A majority of online shoppers (82%), report being very satisfied or somewhat satisfied with the customer support...


12.20.07


Choosing The Right URL Structure

By Mads Kristensen

I've been working on the URL structure on the upcoming version of BlogEngine.NET.

In the current version, the URL wasn't very pretty when viewing posts on certain dates or all posts in a month. It looked like this for a specific date:

example.com/blog/?date=2007-12-19

and like this for a specific month in a year:

example.com/blog/?year=2007&month=12

That's the way they have looked since BlogEngine.NET 1.0 and I must admit they look awful. I just never gave it much thought to improve on them.

Then the other day I gave it some thought and for some stupid reason, I thought it would be cool to use the PathInfo part of the URL instead of the query string. So now the URLs looked like this:

example.com/blog/default.aspx/2007/12/19/

and

example.com/blog/default.aspx/2007/12/

Sign Up For adCenter - Get $50 In Free* Clicks.

This was of course an improvement since they became much more similar and used the same logical structure. The problem is that by using the PathInfo without some kind of URL rewriting at the same time, the relative root URL changes from /blog/ into /blog/default.aspx/2007/12/19/ which of course ruins a lot of things.

Today I finally saw the light. I have no idea why it took me so long, but I guess that late is better than never. The URLs now look like this:

example.com/blog/2007/12/19/default.aspx

and

example.com/blog/2007/12/default.aspx

and because I saw the light I've also added the next logical step, which is to display all posts in a given year like so:

example.com/blog/2007/default.aspx

What's really stupid is that every other blog platform uses this URL structure. I must have had my head up my butt. When I was at it I also changed the calendar URL from

example.com/blog/default.aspx?calendar=show

to

example.com/blog/calendar/default.aspx

All the old URLs still work, so no links will be broken.

The .aspx extension

Now you might wonder why the default.aspx is needed at the end of the URLs. If I had a choice about it, trust me, it would be history. The thing is that on hosted servers where you cannot touch the IIS you will not be able to pass all incoming requests to the ASP.NET ISAPI filter. Only a few extensions including .aspx do. So in order to make sure the URL will work on those servers, we need the .aspx extension. It didn't have to be default.aspx it could be anything ending with .aspx, but I thought default.aspx was one people had seen before and wasn't confused about.

We'll have to wait for IIS 7 to be released before we can construct URLs without the .aspx extension on hosted servers.

You can test the new URL on this blog.

Comments


About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

About DevWebProFrance
DevWebProFrance is for professional developers ... those who build and manage applications and sophisticated websites. DevWebProFrance delivers via news and expert advice New Strategies In Development.

DevWebProFrance is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com


-- DevWebProFrance is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
 © 2007 iEntry Inc.  All Rights Reserved  Privacy Policy Legal  
 

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


New Strategies In Development
DevWebProFrance Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact