Shaun Mccran

My digital playground

08
J
U
N
2009

Redirecting a URL using 301 or 302

If I want to redirect a URL I will usually try and do it on the server side, as this seems like the best fit solution to a redirect. It can be done server side, or in code, examples of both are below.

Whether it is an entire site redirect or a page move necessitating a URL redirect there are some small, but key differences in how to do it.

Differences in 301 or 302 redirects

The 302 redirect is a temporary redirect that indicates to browsers and search engines that it is not a permanent change. This is all well and good, but some engines will overlook this due to knowing that it is a temporary change. Google for instance will not index redirects of this type, effectively leaving your users pointed at the wrong URL.

The 301 redirect is a permanent redirect. It is much more search engine friendly, as they will not skip over it. They read it and cache the destination template as the end point, rather than using the redirect url, so saving your users that extra jump.

Implementing the redirect

In IIS:

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled "a redirection to a URL".
  • Enter the redirection page
  • Check "The exact url entered above" and the "A permanent redirection for this resource" (This makes it a 301 redirect)
  • Click on 'Apply'

In code:

view plain print about
1<cfheader statuscode="301" statustext="Permanent redirect">
2<cfheader name="Location" value="http://www.redirect-url.com">

07
J
U
N
2009

Transferring your contacts to the HTC Magic

I recently changed my mobile to the HTC Magic. Its Vodafone's first Android powered mobile, full touch screen etc... You can read a full spec here.

I do not usually use Gmail, but the phone was directing me towards them on initialisation, so I thought I'd give it a shot.

Transferring the contacts from my N95 to the HTC Magic isn't possible through the Blu tooth connection, as the HTC's Blu tooth protocol does not support data transfer.

So first thing is to get the Nokia Software.

http://www.nokia.co.uk/get-support-and-software/product-support/nokia-n95/software

Install this and run the backup option. After you have backed up you can select an email client to interface with. I'm Windows through and through, so I sync'd my contacts with Microsoft Outlook.

Once in outlook select 'File' – 'Import and Export'. Depending on your version you may get different options here, but in 2007 its 'Export to a file'. Click next, then select 'Comma separated values (Windows). Next select your contacts (or more if you want) and press next. Your data will be exported as a CSV.

Once in outlook select 'File' – 'Import and Export'. Depending on your version you may get different options here, but in 2007 its 'Export to a file'. Click next, then select 'Comma separated values (Windows). Next select your contacts (or more if you want) and press next. Your data will be exported as a CSV.

So a bit long winded, but it works!

03
J
U
N
2009

Google Analytics tracking across multiple domains

I recently came across an issue where an online application was crossing several domains during the customer experience, and the Google Analytics tracking was losing the referrer when they left the originating domain.

The usual Google Analytics tracking code is:

view plain print about
1<s cript type="text/javascript">
2var tracker = _gat._getTracker("#GACode#");
3            tracker._setDomainName("none");
4            tracker._setAllowLinker(true);
5            tracker._initData();
6            tracker._trackPageview();
7</script>

With the addition of two extra lines:

view plain print about
1tracker._setDomainName("none");
2tracker._setAllowLinker(true);

We can force each link to carry the cookie data over to the next domain, maintaining the user data throughout.

There is one other small change. Any href that transitions from one domain to the next has to include an onclick event that tells it to use a tracker method.

view plain print about
1<a href=http://domain.com/page.cfm onclick="tracker._link('http://domain.com/page.cfm'); return false;">Link Text </a>

We need to do something similar to form submissions:

view plain print about
1<form onsubmit="tracker._linkByPost(this)">

In this way the user cookie is maintained across multiple domains.

01
J
U
N
2009

Sony unveils new PSP Go, kind of

Everyone knew that Sony's big E3 announcement was going to be the new PSP Go. As per usual in these situations someone has leaked the specs online already.

  • 3.8-inch display of unknown resolution
  • 43 percent lighter than the current PSP-3000
  • 16GB of flash memory
  • Integrated Bluetooth with mobile phone tethering and BT headset support
  • Memory Stick Micro slot
  • New Gran Turismo, Little Big Planet and Metal Gear Solid games
  • Full PlayStation Network support (TV and movie rentals/purchases) and integration with the PlayStation 3

I have an original psp (model 2000 I think) and it was a good little device. The only problem is that it has no USP. With the way that modern tech has converged it is basically a smartphone without the telephone capabilities. Sure it is good or movie playback, but the screen is almost identical to the iPhone or HTC Magic in terms of size, and now that they have remove the UMD drive its even less distanced from them.

_UNKNOWNTRANSLATION_ /