Thank you for the question. Have you checked to see if the Rotation Lock button was enabled? The Rotation Lock button is now located in the Control Center on your iPhone. If you swipe up from the bottom of the screen, you will see the option to lock or unlock the orientation:
I recommend reviewing the full article if the issue persists:
Thank you for using Apple Support Communities.
I researched my orientation problem for 2 days for my iphone 5. I downloaded an app in the appstore called sensor kinetics which shows current readings for all the sensors. I could see that my accelerometer Z axis was fixed at 97+ value reading, even when the phone was laid down flat on a level table, but the X and Y axis data was fine and fluctuating when the phone is moved. (The ideal reading when laid flat is about 9 for the accelerometer z axis).
I though that the sensor was broken. The calibration approach via the compass did not really fix it for me. Well, out of frustration, having this app open i started slapping the iphone 5 several times against my palm and lo and behold it corrected itself and Z axis value dropped. The reading is still not 9, but something like 12 for Z axis when phone is laid flat, but the most important thing being the auto rotation works for apps. Hope this helps someone, so clearly a matter of playing around till it auto corrects. So the age old banging on electronics approach still works. :-)