get_results("SELECT * FROM guides WHERE guide_id = $id"); // echo $db->debug(); foreach($guide as $g) { $shortname = $g->shortname; } header("HTTP/1.1 301 Moved Permanently"); header("location: http://www.rmiguides.com/about/guides/$shortname"); ?>