Most of the people of knowledge are of the opinion that it is preferred for a person to go to the salah by one route and then to return home through another route, regardless of whether he be the imam or a member of the congregation.
Jabir reports: “On the days of ‘id, the Prophet would take different routes.” This is related by al-Bukhari.
Abu Hurairah says: “When the Prophet went to salatul ‘id, he would return through a different route.” This is related by Ahmad, Muslim, and at-Tirmizhi.
It is permissible to return through the same route by which one goes to the musalla. Bakr ibn Mubashir says: “I used to go with the companions of the Prophet to the musalla on ‘idul azha and on ‘idul fitr, and we passed through a specific valley in Medinah until we came to the place of salah and prayed with the Messenger of Allah, and then we would return to our houses through the same valley.” This is related by Abu Dawud, al-Hakim, and by al-Bukhari in his Tarikh. Ibn as-Sakin says that its chain is acceptable.