Saturday, April 18, 2009

IIS7 Extensionless Urls and Kentico CMS 4.0

Disclaimer: This post contains unsupported guideline for configuring your Kentico CMS 4.x to utilise extensionless urls with IIS 7.0. Use with care!

Base System Requirements: IIS 7.0 with .net 3.5 SP1 on a Windows Vista dev machine or Windows 2008 server to utilise extensionless urls.

Firstly, install the marvellous IIS 7.0 URL Rewrite Module
Get it here: http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1692
Learn about it here: http://learn.iis.net/page.aspx/460/using-url-rewrite-module/

Now, make sure Kentico is configured not to interefere with things…

Kentico automatically applies a filter to the form tags. You need to disable this here:

  • Site Manager > Settings > Output Filters >
  • Ensure the ‘Excluded output form filter URLs’ value is set to a single forward slash.. /
  • Site Manager > Settings > Urls>
  • Ensure the Friendly Url Extensions value is blank

There is currently no way of ensuring that automatically generated urls from Kentico contain a trailing slash. The user must set the Document UrlPath for each page in Page > Properties > Urls to include the trailing slash. However the trailing slash is enforced via in IIS 7 rewriting rule. It is hoped that a future version of Kentico will allow for this to avoid the extra 301 redirect.

Now apply the following website configuration….

Place the following code in the Page_Load of your master page.
            // ensure we fix up the form action if required
            if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]))
            {
                form1.Action = Request.ServerVariables["HTTP_X_ORIGINAL_URL"];
            }

This ensures that Asp.Net postback and ajax work correctly with the IIS7 URL Rewrite Module

Now all you need to do now is apply whatever special rewriting rule syou like within the web.config, utilising the IIS Rewrite Module’s capabilities as you need them. (Note that you don’t need to do anything within IIS, you can manage everything within the web.config and simply deploy it out to target servers without worrying about any additional configuration).

For example, the EnforceTrailingSlash rule below will ensure that a trailing slash is added to all urls without extensions, performing a 301 redirect in the process. This is so to avoid multiple urls (ones with and without slashes) returning the same content which isn’t ideal from an SEO perspective.

The TrailingSlashToAspx rule below will ensure that a trailing slash is rewritten internally to .aspx, so that the kentico rewriting engine can take over. Note that the Kentico CMS folders are ignored (ones starting with CMS..)

<system.webServer>
        <rewrite>
            <rules>
                <rule name=”EnforceTrailingSlash”>
                    <match url=”^(.*)$” ignoreCase=”false” />
                    <conditions>
                        <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”(.*)\.([a-zA-Z]+)(\?.*)?$” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”(.*)/$” />                       
                    </conditions>
                    <action type=”Redirect” url=”{R:1}/” redirectType=”Permanent” />
                </rule>

                <rule name=”TrailingSlashToAspx”>
                    <match url=”^(.*)/$” />
                    <conditions>
                        <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”/cms(.*)$” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”^(.*)/\.aspx[#\w=\|\&amp;%-]*$” />
                    </conditions>
                    <action type=”Rewrite” url=”{R:1}.aspx” />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>

And so there you have it, a relatively painless way to get yourself all SEOd with IIS 7.0 and Kentico CMS 4.0.

Saturday, April 18, 2009 10:06:50 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Tommy’s 3rd Birthday

2009-04-18 2009-04-18 001 0062009-04-18 2009-04-18 001 0042009-04-18 2009-04-18 001 0022009-04-18 2009-04-18 001 001DSC03805DSC03804DSC03803DSC03802DSC03801DSC03800DSC03799DSC03798DSC03797DSC03796DSC03795DSC03794DSC03794DSC03793DSC03792DSC03791DSC03790DSC03789DSC03788DSC03787DSC03786DSC03785DSC03784DSC03783

Saturday, April 18, 2009 9:20:57 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, April 10, 2009

Yellow Maps now live

We’ve just launched another brand spanking new website for Yellow in Yellow Maps. It gives you the ability to do general map and direction searches a la Google but also do specific yellow business listing searches. You can layer on points of interest and see these pop up on your directions from one place to another.

The site was built using Kentico CMS 4, .Net 3.5 SP1, JQuery and the Yellow and Google APIs. Thanks to Calvin, Darren, Campbell and late night pizza from Hell we made it!

Friday, April 10, 2009 1:25:21 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Thursday, April 09, 2009

Quick update

Just a quick post, 1.31am and the rain is battering down outside. I’m up late squishing bugs for another site launch tomorrow and am enjoying the benefits of our new air con system that was put in last week. Went to a parents evening at the day care centre today. Was really tired and wasn’t really feeling like it but it was really great to hear other people and the teachers talk about Tommy. When i got back i told him how proud I was of him and he looked really chuffed with himself and told me loads of stories about what he does at nursery. Normally he says “nothing” when i ask him what he’s been doing (i know, and he’s only 2).

Thursday, April 09, 2009 2:12:01 AM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, March 18, 2009

Lia Rose Patton on the way!

We just had our 20 week scan and found out that we are definitely having a little girl! Due August 4th, very excited. Tommy didn't quite get it and said "I'm going to be a big sister!".

Wednesday, March 18, 2009 9:18:13 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Marker and Yellow partner to bring IE 8 first in New Zealand

My good friend Nigel Parker over at Microsoft beat me to the post with this excellent blog post on Marker Studio's new search site for Yellow and customised IE8 browser experience:

http://blogs.msdn.com/nigel/archive/2009/03/17/yellow-blackcaps-first-to-build-and-deploy-on-ie8-in-new-zealand.aspx

The launch has been very successful with over 10,000 downloads of the Yellow IE8 browser in the first 2 days!

To add a bit of technical detail to Nigel's post we made heavy usage of the Google Search Ajax APIs. I kind of wish they still had the SOAP apis as it would have been easier in many respects using .net to bind the results using server side asp.net rather than be forced to work primarily with the ajax apis. Also, the ajax apis come with handy code snippets http://code.google.com/apis/ajaxsearch/ but they assumed things like ajax calls for paging requests which means the user can't book mark the urls. Aside from that a few workarounds here and there got us enabling Google integrated search quite easily. I would like people to note that the Live Search apis were superior in terms of the range of ways one could consume and make use search services and relevance in my book is very comparable between the two.

We made use of Linq to XML when consuming the core Yellow listings api which is REST based. This made the consumption and binding of the search results to the page using a standard asp.net repeater much easier. In fact, i cringed to think of the additional effort that was involved before Linq for XML in navigating XML Documents with the .net 2.0 xml apis which I never found particularly intuitive.

There is also some Salesforce integration for helping to manage competition entries where we created custom lead objects in Salesforce. It's kind of nice to have the ability to regenerate the wsdl for the web service after you make changes in the gui to core field information. It would be even nicer to have this discoverable at runtime so i could just regenerate proxies using a url rather than having to download the wsdl and re-run svcutil across the wsdl locally.

And let's not forget our good friend JQuery, and loving that Intellisense support in Vs.Net 2008;) Also a shout to facebox for those obligatory modals with rounded corners.

Oh, and the whole thing is powered by Kentico CMS. Kentico CMS is a powerful, flexible and affordable content and document management system that i have been personally recommending to all and sundry since i first came across it in 2005. At Marker  <shamelessPlug>we have a great team of experienced Kentico developers should be looking in this direction. Please give me a yell if you would like to discuss further</shamelessPlug>.

Wednesday, March 18, 2009 8:44:56 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [5]  |  Trackback

Brave Tommy on Log Flume

"I be brave Daddy!"

 TommyLogFlume

Wednesday, March 18, 2009 7:50:22 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, March 09, 2009

New Marker Website

We just launched a brand spanking new website at http://www.markerstudio.com/ go take a look.
Monday, March 09, 2009 6:39:46 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, February 28, 2009

Tommy having fun under the sprinkler

A great video of wee tom having so much fun under the sprinkler with Ellis at Luke and Anniina's house.

 

Saturday, February 28, 2009 10:20:28 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [0]  |  Trackback

A new car!

Here is our new car, a 2003 Nissan March (Micra in UK). Got it online at www.turners.co.nz, quite exciting buying a car online to be honest. I haven't got a clue about cars and have never driven an automatic before but it seems to work ok. All the manuals are in japanese so that's useful. I am so COOL!

28022009693

28022009692

28022009691

One for Carin here. grammar gone to the dog's! NO APOSTROPHE FOR PLURALISING ACRONYMS, PLEASE!

28022009690

annabel's lovely new haircut!

27022009689

tommy dancing with ellis under the sprinkler at luke and anniina's house

22022009685

at jazz in the park in the domain on a lazy sunday

08022009683

Saturday, February 28, 2009 10:19:15 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Monday, February 16, 2009

New Job at Marker

Well, it's not often i have to resort to the obligatory 'sorry it's so long i've posted a blog entry', but you know blogging is so naughties, we should all be twittering now right? Or is it the saddest thing ever?

When i pointed out to my wife that there are over 6 million users of twitter she responded that there's easily enough total geeks in the world to account for that number, fair enough.

Anyway, after a fun and challenging year at www.practiv.com putting together an enterprise service layer (that does sound posh now doesn't it?) underneath www.telecombusinesshub.co.nz i have decided to go back to my roots and join a very exciting and cool web agency over in Ponsonby called Marker (www.markerstudio.com, new website coming soon i'm told!).

I'll be the development manager there overseeing the output of the techie people there, interfacing with clients, designers and other assorted webbie types. Very excited and lots of interesting meaty and high profile projects to kickstart the year.

I'll be starting my new venture on March 2nd and would like to bud a fond farewell to all and sundry who might have bumped into me during the last year and who i will probably not be seeing for a while.

Monday, February 16, 2009 11:32:42 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, January 29, 2009

Twitter Feed and Friend Feed

I just realised there exists today more helpful free software than i could ever possibly imagine. A few years back I remember it being hard to find good little utilities to do even the most basic things like FTP in a reliable usable way.

TwitterFeed.com

Anyways...I've resuscitated my usage of Twitter by using www.twitterfeed.com. Essentially, this allows me to automatically prefix and post up tweets from RSS Feeds.

In my case, i'm automatically tweeting from Google Reader shared items (i simply click a share item in Google Reader, and a tweet is imminent..) and from this blog.

FriendFeed.com

In addition, i thought i would blabber a bit about www.friendfeed.com which is essentially an aggregation portal for your online activity.

I've integrated friendfeed activity directly into my blog (on the right hand side panel) which should make some of the things i'm doing without the need for formal blog posts.

You *could* if you wanted have twitter feed pull from all your online activity via freidn feed, but you would have to exclude twitter from friendfeed to avoid a nasty infinite loop of friendfeed/twitter posts;)

To avoid this, you can filter the friendfeed rss by service, but you can only select one service;( i wanted to create a feed for everything apart from twitter but couldn't do this.

This is why i'm manually adding feeds to twitterfeed.

Have fun!

Thursday, January 29, 2009 8:24:29 PM (New Zealand Daylight Time, UTC+13:00)  #    Disclaimer  |  Comments [669]  |  Trackback