Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:101

And when you travel throughout the land, there is no blame upon you for shortening the prayer, ˹especially˺ if you fear that those who disbelieve may disrupt ˹or attack˺ you. Indeed, the disbelievers are ever to you a clear enemy.  

And when you are going forth, travelling, in the land you would not be at fault if you shorten the prayer, by making it two ˹genuflexions˺ instead of four, if you fear that you may be afflicted by those who do not believe, that is, ˹if you fear˺ that you may be harmed ˹by them˺: this ˹fear of affliction at the hands of the disbelievers˺ is ˹just intended as˺ an explication of the reality ˹of the situation˺ at that time and the point no longer applies. In the Sunna, it is pointed out that ‘travel’ (safar) means long-distance ˹travel˺, which is ˹approximately˺ 50 miles. God’s words ‘you would not be at fault’ should be understood as ˹denoting˺ a dispensation and not a requirement, and this is the opinion of al-Shāfi‘ī; the disbelievers are a manifest foe to you, their enmity being evident.
القرآن:٤:١٠١

وَإِذَا ضَرَبْتُمْ فِي الْأَرْضِ فَلَيْسَ عَلَيْكُمْ جُنَاحٌ أَنْ تَقْصُرُوا مِنَ الصَّلَاةِ إِنْ خِفْتُمْ أَنْ يَفْتِنَكُمُ الَّذِينَ كَفَرُوا ۚ إِنَّ الْكَافِرِينَ كَانُوا لَكُمْ عَدُوًّا مُبِينًا  

{وإذا ضربتم} سافرتم {في الأرض فليس عليكم جُناح} في {أن تَقصروا من الصلاة} بأن تردُّوها من أربع إلى اثنتين {إن خفتم أن يفتنكم} أي ينالكم بمكروه {الذين كفروا} بيان للواقع إذ ذاك فلا مفهوم له وبينت السنة أن المراد بالسفر الطويل وهو أربع برد وهي مرحلتان ويؤخذ من قوله تعالى: (فليس عيكم جُناح) أنه رخصة لا واجب وعليه الشافعي {إن الكافرين كانوا لكم عدوا مبينا} بيّني العداوة.