Wednesday, 9 October 2013

Redirecting .co.uk to .com with ASP.net MVC IIS7 URL ReWrite 2.0

I recently started work on a new website, where I’ve purchased the .co.uk and .info domain names. However, I wanted to redirect people automatically to the main .com domain.
As my host supports the IIS7 URL ReWrite 2.0 moduke, adding the following section to the primary web.config file solved this for me;
   1: <rewrite>

   2:       <rules>

   3:         <rule name="RedirectToWWW1" stopProcessing="true">

   4:           <match url=".*" ignoreCase="true" />

   5:           <conditions logicalGrouping="MatchAny">

   6:             <add input="{HTTP_HOST}" pattern="^mydomain.co.uk$" />

   7:             <add input="{HTTP_HOST}" pattern="^mydomain.info$" />

   8:             <add input="{HTTP_HOST}" pattern="^www.mydomain.co.uk$" />

   9:             <add input="{HTTP_HOST}" pattern="^www.mydomain.info$" />

  10:           </conditions>

  11:           <action type="Redirect" url="http://www.mydomain.com/{R:0}" redirectType="Permanent" />

  12:         </rule>

  13:       </rules>

  14:     </rewrite>

Tuesday, 1 October 2013

svchost.exe consumes 100% CPU on Windows XP, caused by Windows Updates

I reinstalled Windows XP on a clients PC recently, and came up against an issue where I couldn’t update Windows using Windows Update. I then noticed that the PC had slowed down to a crawl. Opening up Task Manager, Processes and Sorting by CPU, I found that svchost.exe was consuming 100% CPU.

I tried killing the process, and retrying the updates, but svchost.exe was back to 100% as soon as I did.

Having searched around multiple forums for a long time, I finally found a solution which sorted the problem;

Firstly, download Internet Explorer 8 for Windows XP - http://www.microsoft.com/en-gb/download/internet-explorer-8-details.aspx

Once that has downloaded, install the hotfix KB2870699 for IE8 - http://www.microsoft.com/en-us/download/details.aspx?id=40119

Hey presto, problem solved. You can now use Windows update and install the 300+ updates that are required!