The Rams (1-3) had an overtime win and tie against San Francisco last year, and took the early lead Thursday before falling flat. Greg Zuerlein banged in a 40-yard field goal off the right upright to end a nine-game scoring drought in the first quarter, but the 49ers answered with 28 straight points.
"Tomorrow's going to be a pretty tough day in the film room," Rams quarterback Sam Bradford said. "The good news is we have 10 days, 11 days until we play again and there's going to be ample time to get that corrected."
St. Louis was held to 188 total yards and was completely stuffed on the run, with 18 yards on 19 carries.
"That's what we do," said safety Donte Whitner, who had an interception in the end zone. "We stop the run first, then we stop the pass and then we get away with wins."
The 49ers came close to a Super Bowl title in February and regained their footing against the team that gave them the most trouble last season. Minus cornerback Nnamdi Asomugha and linebackers Patrick Willis and Aldon Smith, they quieted a raucous, hopeful crowd, sending all but a few thousand home early.