Blog of Steve Savage A blog for business analysts and architects, and fellow user's of Sparx's EA

2Jan/110

Transferring my old content to the transitional site.

One of my key requirements was to transfer  the content from my old site to the new site without breaking any links from external sites.

There are two reasons for this:

  • Referred visitors.
  • Search Engine Ranking.

The best way to move a page an let everyone know that it is a permanent move is to send the 301 Moved permanently, header.    Because old site was done in ColdFusion 8, the solution was fairly straight forward.

First, I added the onMissingTemplate to my old application.cfc file.

<cffunction name="onMissingTemplate" access="public" returntype="string">
  <cfargument name="requested" type="string" required="true"
     hint="I am the template that the user requested." />
</cffunction>

Next, because I wanted to map specific pages to their new location, I added

<cffunction name="onMissingTemplate" access="public" returntype="string">
  <cfargument name="requested" type="string" required="true"
     hint="I am the template that the user requested." />
  <cfset template="/index.php">
  <cfscript>
     if(findNoCase("/content/500/1.en.cfm",requested)) template = "/?page_id=2";
     else if(findNoCase("/content/500/2.en.cfm",requested)) template = "/?p=60";
  </cfscript>
  <cfheader statuscode="301" statustext="Moved permanently">
  <cfheader name="Location"  value="#template#">
</cffunction>

The final step is to delete all the old .cfm pages on my site. Now whenever someone goes to an old link, they will be send a 301 message, and redirected to the pages new WordPress address.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.