Another proof of the merit of walking to the mosques—even when they are far away—is the ḥadīth of Jābir regarding the clan of Banū Salimah. He relates that the area around the mosque had become vacant of houses, so the Banū Salimah wanted to come nearer to the mosque. When news of this reached the Prophet (peace and blessings be upon him), he asked them about it. They said, “Yes, we intend to move so we can be closer to the mosque.” He said, “O Banū Salimah, stay in your homes; your footsteps are being recorded for you.” In other words: remain where you are and do not come closer, for your steps will be written down.
This indicates that the farther a person’s house is from the mosque, the greater his reward, because of the Prophet’s words, “your footsteps are being recorded.” This does not mean that a person should purposely choose to live far from the mosque. However, if circumstances dictate that he can only pray in a distant place, or if an entire community’s dwellings are far away and the like, then every step he takes is recorded for him. Thus the virtue of walking to the mosques is established. Allah’s bounty is vast and His gifts are abundant; He grants a great reward for a small deed. We ask Allah, for ourselves and for you, for His immense favor.
1057 – Abu Mūsā (may Allah be pleased with him) reported that the Messenger of Allah (peace and blessings be upon him) said: “The people who receive the greatest reward for the prayer are those who walk the farthest distance to it—those farther, and then those farther still. And the one who waits for the prayer until he prays it with the imām has a greater reward than the one who prays it and then goes off to sleep.” (Agreed upon)