Al-Ilmam bi-Ahadith al-Ahkam 265
وَعَن أبي الزبير، عَن جَابر رَضِيَ اللَّهُ عَنْه ﷺ " أَن النبيَّ ﷺ عَاد مَرِيضا فَرَآهُ يُصَلِّي عَلَى وسَادَة، فَأَخذهَا فَرَمَى بهَا، فَأخذ عوداً ليُصَلِّي عَلَيْهِ، فَأَخذه فَرَمَى بِهِ، وَقَالَ لَهُ : صل عَلَى الأَرْض إِن اسْتَطَعْت، وَإِلَّا فأوم إِيمَاء، وَاجعَل سجودك أَخفض من ركوعك ". وَفِي رِوَايَة: " إِن أطقت أَن تصلي عَلَى الأَرْض وَإِلَّا … ". لفظ الْبَيْهَقِيّ فيهمَا.
And from Abu az-Zubayr, from Jabir, may Allah be pleased with him: "The Prophet ﷺ visited a sick man and saw him praying on a pillow. He took it and threw it away. Then he took a stick to pray on, and he took it and threw it away, and said to him: 'Pray on the ground if you can; otherwise make gestures, and make your prostration lower than your bowing.'" And in a narration: "If you are able to pray on the ground, [do so]; otherwise..." The wording in both is al-Bayhaqi's.