Northampton equalled their biggest win of the season with a first home success over the Millers in 34 years.
Goals by Kenny Deuchar, Mark Hughes and Ian Taylor all came in the first half, allowing the Cobblers to take their foot off the brake against hapless Rotherham, whose run without a win now stretches 13 matches and goes back to early December.
Both Deuchar and Hughes scored their first goals for the club. The on-loan Gretna striker opened things up in the 15th minute when he chased a long through ball and dived in to dispossess goalkeeper Neil Cutler before prodding home the loose ball.
Six minutes later it was 2-0 when a pinpoint free-kick by Bradley Johnson was met by the head of Hughes, who directed his effort beyond Cutler.
Cutler had already denied Sam Aiston with an outstretched leg and he needed to be at his best in the first half to keep the score down.
Soon after Jordan Robertson set up Johnson who curled a shot just over before a great strike by Robertson produced a top-notch save from Cutler.
But in the final minute of the first half the home side cruised into a 3-0 lead when Johnson's free-kick to the back post was met by the head of former Aston Villa veteran Taylor and the ball looped over Cutler and, despite the efforts of a defender, ended in the roof of the net.
The second half was something of an anti-climax with the visitors failing to offer any sort of threat, while Northampton could have added to their tally.
On the hour, an excellent cross by Jason Crowe brought a header from Deuchar which drifted just wide, while Johnson saw his 78th minute volley well saved by Cutler.
In one of the visitors' rare ventures into the Northampton half, young defender Stephen Brogan let fly from 30 yards with a shot which just cleared the crossbar.
But the final word inevitably came from the Cobblers, who have now notched crucial back-to-back wins inside the space of five days to give themselves breathing space from the club's fight against relegation.
In that finale, Robertson had a chance to extend the lead but his free-kick lacked venom after being deflected by the defensive wall.