New York State Route 31E (NY 31E) is a state highway located in western New York in the United States. It serves as a northerly alternate route of NY 31 between the village of Middleport in eastern Niagara County and the nearby village of Medina in Orleans County. NY 31E connects to NY 31 at each end by way of a short overlap with NY 271 in Middleport. Most of NY 31E parallels the Erie Canal, and parts of the route run adjacent to the waterway. Outside of the two villages at each end, NY 31E traverses mostly rural areas of the towns of Royalton and Ridgeway. The origins of the route date back to 1914 when its routing was included as part of a spur route of Route 30, a cross-state, unsigned legislative route. The spur route was eliminated in 1921, and the road went unnumbered until 1930 renumbering of state highways in New York when it became part of NY 3. Most of NY 3 west of Rochester was replaced by NY 31 in the mid-1930s, and NY 31 was realigned onto its present, more southerly alignment between Middleport and Medina in 1949. Its former canalside alignment became NY 31E at this time. Most of NY 31E is maintained by the New York State Department of Transportation (NYSDOT); however, two sections in Niagara County and Medina are locally maintained. Route description NY 31E begins at an intersection with NY 31 in the village of Middleport in eastern Niagara County. The route heads north as Main Street, overlapping with NY 271 (which also begins at NY 31) through the mostly residential village. Just south of the Erie Canal, NY 31E and NY 271 enter Middleport's small business district, centered on the junction of Main and State Streets. Here, NY 31E and NY 271 split, with NY 31E following State Street eastward through the eastern portion of the community. Along this stretch, the route serves Royalton–Hartland High School and Royalton-Hartland Middle School before exiting Middleport and entering a slightly more open area of the town of Royalton. NY 31E runs past undeveloped land to the north and a smattering of homes to the south on its way into the Orleans County town of Shelby New York|Ridgeway]]. East of the county line, NY 31E becomes Telegraph Road and continues across increasingly less developed areas of Ridgeway. The Erie Canal is visible