Hi Ralph, Apparently it used to be possible to set the side switch to lock screen orientation instead but this was removed sometime during iOS9. Setting mute to vibrate might alert you to accidental selection. Settings>Sounds>Vibrate on Silent
(I hope it's the same on the iPhone 7, I've got an SE )
Good luck