The prayer was prescribed as consisting of two rak'ahs both when one was resident and when travelling. The prayer while travelling was left according to the original prescription and the prayer of one who was resident was enhanced.
فُرِضَتِ الصَّلاَةُ رَكْعَتَيْنِ رَكْعَتَيْنِ فِي الْحَضَرِ وَالسَّفَرِ فَأُقِرَّتْ صَلاَةُ السَّفَرِ وَزِيدَ فِي صَلاَةِ الْحَضَرِ