In-wheel motor vehicles are gaining attention as a new type of electric vehicle due to their efficient power units located inside each wheel hub. However, they are more susceptible to wheel resonance due to the increase in unsprung mass caused by the motor's weight. This can result in decreased both the ride comfort and driving stability. To resolve this issue, this study aims to apply an optimal switching controller with a semi-active n actuator; magnetorheological (MR) damper. For the implementation of the optimal switching controller, a road type classification is also carried out. An acceleration sensor is used for road type classification, and control logics include a ride comfort controller; the linear quadratic regulator (LQR _Paved Road) and a wheel motion controller (LQR_Off Road) for improved driving stability. For paved roads, the LQR_Paved Road control input is applied to the MR damper. However, if a road type prone to wheel resonance is detected, the control logic switches to the LQR_Off Road. During the transition, a weighted average of both LQR_ Paved Road and LQR_Off Road control input is applied to the actuator. Computer simulations are undertaken to evaluate vibration control performance, including the ride comfort and driving stability at various road profiles.