by Ric Crouch.
I had the same problem, and here is the easiest fix I found. It's a two step process...
1) Edit "<your moodle root>/login/logout.php" to change the line:-
$redirect = $CFG->wwwroot.'/';
to...
$redirect = $CFG->logouturl;
Then, in your config.php set a value for $CFG->logouturl e.g.
Hope this makes it clear...
Thanks to Graeme for his response at https://moodle.org/mod/forum/discuss.php?d=105672
$logouturl = $CFG->logouturl = 'http://where.Iwanttogo.com?and=parameters';
Ric