This paper presents a continuous wall-following controller for wheeled mobile robots based on odometry and distance information. The reference for this controller is the desired distance from the robot to the wall and allows the robot to follow straight wall contour as well as smoothly varying wall contours by including the curvature of the wall into the controller. The asymptotic stability of the control system is proved using a Lyapunov analysis. The controller is designed so as to avoid saturation of the angular velocity command to the robot. A novel switching scheme is also proposed that allows the robot to follow discontinuous contours allowing the robotic system to deal with typical problems of continuous wall-following controllers such as open corners and possible collisions. This strategy overcomes these instances by switching between dedicated behavior-based controllers. The stability of the switching control system is discussed by considering Lyapunov concepts. The proposed control systems are verified experimentally in laboratory and office environments to show the feasibility and good performance of the control algorithms.