The Prophet (ﷺ) used to go to the Mosque of Quba (sometimes) walking and sometimes riding…

Sahih al-Bukhari Book 20 Hadith 6

Sahih al-Bukhari #1194

Virtues of Prayer at Masjid Makkah and Madinah 20:6

Narrated Ibn `Umar:

The Prophet (ﷺ) used to go to the Mosque of Quba (sometimes) walking and sometimes riding. Added Nafi` (in another narration), "He then would offer two rak`at (in the Mosque of Quba)."

Chapter: To go to the Mosque of Quba

Grade: Sahih