كتاب فضائل الجهاد عن رسول الله صلى الله عليه وسلم
22
The Book on Virtues of Jihad
(16)
Chapter: What Has Been Related About One Who Fights For Show And For Worldly Matters
(16)
باب مَا جَاءَ فِيمَنْ يُقَاتِلُ رِيَاءً وَلِلدُّنْيَا
Jami` at-Tirmidhi 1647
Narrated 'Umar bin Al-Khattab:

That the Messenger of Allah (ﷺ) said: "Deeds are but with intentions, and for the man is only what he intended. So one whose emigration was to Allah and His Messenger, then his emigration was to Allah and His Messenger. And one whose emigration was to the world, to attain some of it, or woman, to marry her, then his emigration was to what he emigrated.

[Abu 'Eisa said:] This Hadith is Hasan Sahih. Malik bin Anas, Sufyan Ath-Thawri and more than one of the A'immah narrated this Hadith from Yahya bin Sa'eed. And we do not know of it except as a narration from Yahya bin Sa'eed Al-Ansari. 'Abdur Rahman bin Mahdi said: "It is necessary that we put this Hadith in every chapter."

حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا عَبْدُ الْوَهَّابِ الثَّقَفِيُّ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ مُحَمَّدِ بْنِ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ بْنِ وَقَّاصٍ اللَّيْثِيِّ، عَنْ عُمَرَ بْنِ الْخَطَّابِ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِنَّمَا الأَعْمَالُ بِالنِّيَّةِ وَإِنَّمَا لاِمْرِئٍ مَا نَوَى فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى اللَّهِ وَإِلَى رَسُولِهِ فَهِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ وَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوِ امْرَأَةٍ يَتَزَوَّجُهَا فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ ‏"‏ ‏.‏ قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ ‏.‏ وَقَدْ رَوَى مَالِكُ بْنُ أَنَسٍ وَسُفْيَانُ الثَّوْرِيُّ وَغَيْرُ وَاحِدٍ مِنَ الأَئِمَّةِ هَذَا عَنْ يَحْيَى بْنِ سَعِيدٍ وَلاَ نَعْرِفُهُ إِلاَّ مِنْ حَدِيثِ يَحْيَى بْنِ سَعِيدٍ الأَنْصَارِيِّ ‏.‏ قَالَ عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ يَنْبَغِي أَنْ نَضَعَ هَذَا الْحَدِيثَ فِي كُلِّ بَابٍ ‏.‏
GradeSahih (Darussalam)
Reference : Jami` at-Tirmidhi 1647
In-book reference : Book 22, Hadith 30
English translation : Vol. 3, Book 20, Hadith 1647