28 - حَدَّثَنَا الْحُمَيْدِيُّ، ثنا سُفْيَانُ، ثنا يَحْيَي بْنُ سَعِيدٍ، أَخْبَرَنِي مُحَمَّدُ بْنُ إِبْرَاهِيمَ التَّيْمِيُّ أَنَّهُ سَمِعَ عَلْقَمَةَ بْنَ وَقَّاصٍ اللَّيْثِيَّ يَقُولُ: سَمِعْتُ عُمَرَ بْنَ الْخَطَّابِ عَلَي الْمِنْبَرِ يُخْبِرُ بِذَلِكَ عَنْ رَسُولِ اللَّهِ صَلَّي اللهُ عَلَيْهِ وَسَلَّمَ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّي اللهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: «إِنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَي، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَي اللَّهِ وَرَسُولِهِ، فَهِجْرَتُهُ إِلَي اللَّهِ وَرَسُولِهِ، وَمَنْ كَانَتْ هِجْرَتُهُ إِلَي دُنْيَا يُصِيبُهَا أَوْ إِلَي امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَي مَا هَاجَرَ إِلَيْهِ»
Alqamah bin Waqas Laithi narrates: I heard Sayyiduna Umar bin Khattab (may Allah be pleased with him) on the pulpit relating this narration from the Noble Prophet (peace and blessings be upon him): He says: I heard the Noble Prophet (peace and blessings be upon him) say: "Actions are judged by intentions, and every person will get only what he intended. So whoever's migration was for Allah and His Messenger (peace and blessings be upon him), then his migration is for Allah and His Messenger. And whoever's migration was for worldly gain to attain it, or for a woman to marry her, then his migration is for that for which he migrated."
Related hadith on this topic