In 2002, Ritchie was appointed as "chargé d'affaires" at the Australian Embassy in Jakarta until a replacement for Ric Smith was appointed. Some saw David Irvine as a good replacement for Smith, given his knowledge of the Indonesian language, but Ritchie was appointed as the Ambassador of Australia to Indonesia by the Australian government to oversee the relationship between the two countries, which is seen as one of the most complex. He served in this position until 2005, including at the time of the 2004 Australian Embassy bombing in Jakarta, and the 2005 Bali bombings. For his work at this time, Ritchie was awarded the Group Bravery Citation on 29 August 2005 and made an Officer of the Order of Australia (AO) on 13 June 2005 for "service to ensuring Australia's long-term security interests in the region through efforts to gain co-operative action to address the threat of terrorism."