Imam Al-Nawawi's Riyad-us-Saliheen
Chapter 98
Excellence of Adopting Different Routes for going and returning on 'Eid Prayer and various other Occasions

719. Jabir (May Allah be pleased with him) reported: On the occasion of the `Eid, the Prophet  (sallallaahu ’alayhi wa sallam) would proceed to the prayer place taking one route and returning from another.
[Al-Bukhari and Muslim].

Commentary: The `Ulama' say that there are many subtle points of wisdom in changing the way. According to Imam An-Nawawi, this causes an increase in the places of worship. Some say that both ways will bear witness on the Day of Reckoning, that he had passed through them in a state of worship. This may also be the object that instead of one way, the needy on two ways should benefit from alms and charity.

720. Ibn `Umar (May Allah be pleased with them) reported: Messenger of Allah (sallallaahu ’alayhi wa sallam) used to go by way of Ash-Shajarah and return by way of Al-Mu`arras. He would also enter Makkah through the Higher Pass and would leave it through the Lower Pass.
[Al-Bukhari and Muslim].

Commentary:  It was the habit of Messenger of Allah (sallallaahu ’alayhi wa sallam) that while going to Makkah from Al-Madinah, he would adopt the route of a shallow ravine and his return route being always a deep ravine. Ash-Shajarah is a well-known place. He would pass through it and reach Dhul-Hulaifah and spend a night there. Yet, he would proceed to Al-Madinah through Al-Mu`arras, a name given to Dhul-Hulaifah Masjid (mosque) which is six-mile away from Al-Madinah. Again this is to be concluded that while returning to our destination from any place, we should choose a different route because this was exactly the habit of the Prophet (sallallaahu ’alayhi wa sallam) .