While left tackle Jake Long apparently decides between the Rams and Miami, Rams safety Craig Dahl has decided on San Francisco.

That’s right, after four seasons and 40 starts for St. Louis, Dahl signed a three-year contract Saturday with one of the Rams’ biggest rivals.

“They’re not the enemy anymore,” Dahl said, laughing. “It’s a program I’m really familiar with. You know players and coaches. I’m familiar with how they operate and what the basis of their team fundamentals are. . . . Couldn’t be happier with the opportunity I’ve been given.”

In San Francisco, Dahl will have a chance to compete for the starting job vacated by Pro Bowler Dashon Goldson, who has joined Tampa Bay via free agency. Louis Delmas, whom the Rams had brought in for a visit Wednesday, preceded Dahl in visiting San Francisco before deciding to re-sign with Detroit.

San Francisco also brought in Charles Woodson for a visit earlier in the week, and there were reports that the 49ers were interested in Ed Reed as well. But surprisingly, it’s Dahl who was signed among that group.

“We are pleased to announce the signing of Craig,” 49ers general manager Trent Baalke said in a statement. “He is an experienced veteran with excellent intangibles, who has working knowledge of the NFC West.”

Along those lines, maybe Dahl can help the 49ers figure out how to beat the Rams, who had a victory and a tie in two overtime games against the NFC champions last season.

The Rams weren’t interested in bringing Dahl back, although according to Dahl there were at least some talks with them. But quietly there was a fair amount of interest in him around the league.

“My agent had a handful of other teams that we were in discussion with during the whole free agency process,” Dahl said.

The Rams liked Dahl for his intelligence and toughness. He made sure everyone got lined up correctly in the back end, and was the kind of player coaches like. But the Rams want to get more athletic at the position.

“They had open doors,” Dahl said of the Rams. “Obviously, they felt that they need improvement. They wanted to release Quintin (Mikell). We were in negotiations but ultimately I came down here and I felt the love and reciprocated.”

All five safeties on the Rams’ roster last season entered the league as undrafted rookies: Dahl, Mikell, Darian Stewart, and rookies Rodney McLeod and Matt Daniels. Unless Mikell re-signs for less money, the Rams will have two new starting safeties in 2013.

Dahl started all 16 games for the Rams last season, the first time he had done that in five NFL seasons. He finished with 100 tackles along with one interception and two pass breakups. Dahl, 27, entered the league with the New York Giants in 2007 and joined the Rams via free agency in 2009.

As for Long, after his marathon visit in St. Louis, he left with a contract offer Friday but no agreement. He returned to Miami where he has played his first five seasons. Long was in the Dolphins’ complex Saturday, according to reports by CBSsports.com and others.

If Long opts for Miami, the Rams will have spent more than three days basically negotiating a contract for the Dolphins. That would be a bitter pill to swallow for the Rams since several of the top offensive tackles in free agency have gone off the market during that time, including Jermon Bushrod, Phil Loadholt, and Sam Baker. Still out there are Sebastian Vollmer and Andre Smith, who are represented by CAA, the same sports agency that represents Long.

In no particular order, safety, offensive tackle, and wide receiver are the Rams’ biggest needs, and so far other than the signing of Jared Cook they have been unable to fill any of those holes. Cook is a tight end, but because of his speed (4.49) and the fact that he will line up in the slot much of the time, he’s almost like a big wide receiver.

So far the Rams have lost Steven Jackson (Atlanta), Danny Amendola (New England), Brandon Gibson (Miami), Bradley Fletcher (Philadelphia) and Dahl in free agency. Also, guard/tackle Chris Williams has made a free-agent visit to Carolina.

But of that group, Jackson and Amendola were the only players the Rams had more than passing interest in re-signing. In signing a three-year deal with Miami on Friday, Gibson said as much in regards to his own situation.

“St. Louis was the place I wanted to be, but I think they wanted to go in a different direction with the receivers they drafted,” Gibson said. “They have a lot of faith in them, and I as well have a lot of faith in them.”

Gibson was speaking specifically of Chris Givens, Brian Quick, and Austin Pettis.

Gibson obviously made a good impression on the Dolphins in the Rams’ 17-14 loss Oct. 14 in Miami. In that game he had a season-high seven catches for 91 yards – the third-highest yardage total of his career. Among those catches was a spectacular leaping grab down the left sideline as the Rams tried to rally in the closing minutes of play.

Follow Jim Thomas on twitter @jthom1

Jim Thomas is the lead Rams beat writer for the St. Louis Post-Dispatch.