(15) باب الأَبْعَدُ فَالأَبْعَدُ مِنَ الْمَسْجِدِ أَعْظَمُ أَجْرًا
It was narrated that Anas said:
"Banu Salimah wanted to move from their homes to somewhere near the mosque, but the Prophet did not want the outskirts of Al-madinah to be left vacant, so he said: 'O Banu Salimah, do you not hope for the reward of your footsteps?' So they stayed (where they were)."
Reference: Sunan Ibn Majah 784
In-book reference: Book 4, Hadith 50
English translation: Vol. 1, Book 4, Hadith 784