Anas bin Malik reported,

The Banu Salama wanted to relocate from their homes to a place near the mosque, but the Prophet ﷺ disliked that the area around Madinah be left empty. He said, "Banu Salama, will you not seek reward for your footsteps?" So they remained where they were.

Ibn Majah 784

Sahih

حدثنا أبو موسى محمد بن المثنى حدثنا خالد بن الحارث حدثنا حميد

عن أنس بن مالك قال

أرادت بنو سلمة أن يتحولوا من ديارهم إلى قرب المسجد فكره النبي ﷺ أن يعروا المدينة فقال يا بني سلمة ألا تحتسبون آثاركم فأقاموا

ابن ماجه 784صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Mosques and congregations
Chapter
Walking to prayer
Numbering
Darussalam 784
Ibn Majah 784