Ibn ‘Umar said that on a journey God’s Messenger would pray on his riding beast in whatever direction it turned, making a sign with his head* in prayer during the night, but not in the obligatory prayers; and he would observe a witr on his riding beast.
I went on an expedition with the Prophet, and I was present with him at the Conquest. He stayed eighteen days in Mecca and prayed only two rak'as . He said, “You who live in the town must pray four; we are travellers.”
Ibn ‘Abbas said that God’s Messenger used to combine the noon and the afternoon prayer while travelling, and also to combine the sunset and the evening prayer.