Redirect using IIS7

by Matti Lehtinen January 20, 2010 09:27

It is essential that the same content is found only under single URL. Alias URLs should be redirected to the main URL. Otherwise you may get "duplicate content penalty" by Google which gets your site lower on search results. E.g. if you have domains www.foobar.com and www.foobar.net, you want the .net to be forwared to the .com.

On IIS 7 redirection can be made by following steps:

1. Install IIS 7 Rewrite Module (Requires Reboot!)

2. Edit web.config file of your site. The code should be put under <system.webServer> element. The following example redirects from www.foobar.net, foobar.net and foobar.com to www.foobar.com.


<rewrite>
 <rules>
 <rule name="Redirect to www.foobar.com" stopProcessing="true">
  <match url=".*" />
  <conditions logicalGrouping="MatchAny">
  <add input="{HTTP_HOST}" pattern="^foobar\.net$" />
  <add input="{HTTP_HOST}" pattern="^www\.foobar\.net$" />
  <add input="{HTTP_HOST}" pattern="^foobar\.com$" />
  </conditions>
  <action type="Redirect" url="http://www.foobar.com/{R:0}" redirectType="Permanent" />
 </rule>
 </rules>
</rewrite>

Note that redirectType should be "Permanent". This creates "301 Moved Permanently" redirection which is most SEO friendly.

Tags: , ,

General | SEO

Key Points from Microsoft Techdays 2009 Finland

by Matti Lehtinen March 07, 2009 21:01

Here are my key points from Techdays conference which was held in Helsinki on 5th - 6th of March:

  1. Visual Studio 2010 and .NET framework 4.0 are almost here. Get ready.
  2. ASP.NET 4.0
    • One click deployment that creates a package file (uses MSDeploy). This can be compared to .jar packages of java.
    • Support for multiple web.config files without needing to copy-paste.
    • AJAX Client Templates will change the way we are writing JavaScript.
    • ASP.NET MVC- a new alternative to Web Forms
  3. Azure Services Platform
    • Less worries about environment and scalability.
    • Note that SQL Data Services != MS SQL Server.
  4. SharePoint 2007
    • Application lifecycle must be planned carefully because there are many challenges especially with upgrading the application.
    • See patterns & practices SharePoint Guidance. It contains plenty of useful information.
    • Check Prism V2 if you are planning to use Silverlight 2.0 with SharePoint. It contains patterns and practices to develop modular, rich applications.
  5. Pex and Chess are really cool new tools which will help you to catch bugs.

TechDays videos will be available at codezone.fi.

Tags: , , , , , ,

Visual Studio | General | ASP.NET | SharePoint

BlogEngine.NET up and running.

by Matti Lehtinen August 31, 2008 13:55

This is my first blog entry using BlogEngine.NET. At first glance it looks a great option for people like me who want .NET based blogging solution. Installation was easy and there is plenty of extensions available. A nice feature was that the blog sidebar can be edited just by dragging & dropping altough that feature seems to work only with Internet Explorer. I think I have now configured everything properly and should be able to start blogging.

This blog will be mainly about .NET development, technologies and tools. I will write about my own ideas, findings and experiences from the .NET world rather than linking to others' content. I'm a software developer myself so this blog will be more professional than personal blog. I am from Finland and not a native English speaker so please excuse my English.

Tags:

General | BlogEngine.NET

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant