One simple trick many don’t know I keep getting asked about this many times. Unlike its bigger cousin iPad, iPhone does not have a Side Switch to lock screen orientation, but there’s still a way to do it quickly via the multitasking bar.
Just press the Home button twice. After you see the multitasking bar, swipe to the right and look for the icon below.
Tap on the icon, it should change into a lock.
Exit from multitasking bar by clicking the Home button once and you will see the indicator on the top to indicate the orientation is locked.