Thursday, 15 July 2010

Directing all visits to the www subdomain using IIS7

Your SEO champion will no doubt be banging his fists on his desk if you've built a site that allows users to view the same content on as well as

What he or she will be demanding is that one of them permanently redirects the user (with a 301 status) to the other. So how do you do this? Well, there might be several ways but this is the way I do it. For this example I'm going to be sending visitors from to

Remove the '' entry from the bindings of your website but keep the '' entry. Create a new website and call it ' redirect' or something similar. Add a binding to this for ''. This will then accept incoming visits to ''. Now click on the 'HTTP Redirect' icon:

and configure the site to redirect to '' with a Permanent(301) setting like below:

This will also honour any deep links to your site. For example if a user goes to they will be redirected to

UPDATE: on some machines you may not see the 'http redirect' icon. If this is the case go to the IIS section in 'Server Manager' and you'll probably see the role service isn't installed. You can install it easily from here.

Wednesday, 14 July 2010

Solving an updatepanel cacheing problem with SetCacheability

I had an issue today with the contents of an update panel appearing to be cached when they should have displayed a more recent listview of search results. Frustratingly this problem was only happening on the server copy of my site rather than locally.

I resolved the problem with the following code in the page load event:
UPDATE: ah, so it never worked for Firefox...I went for a solution using a session object instead!

Friday, 2 July 2010

Submitting a sitemap for your Blogger/Blogspot blog

I found this very helpful post on how to submit sitemaps for a blogger blog.

In summary, you need to do the following:

If you have under 500 posts:

If you have under 1000 posts:

If you have under 1500 posts: