Even O.J. Simpson is warning that Bill Cosby should watch his back behind bars — because “rapists are frowned upon in prison.”

“I’m sure there will be guys protecting him but they’re gonna have to put him in protective custody … because it takes one nut, ya know?” Simpson, 71, told TMZ while out golfing in Nevada on Wednesday.

“The problem is the nature of the crime,” added Simpson, who spent nine years behind bars for kidnapping and armed robbery.

Cosby was slapped Tuesday with three to 10 years in Pennsylvania state prison for sexually assaulting Andrea Constand in 2004. Roughly 60 women have come forward to say the disgraced comedian committed sex crimes against them, including rape.

So far, the former Jell-O pitchman is being kept alone in a cell at the State Correctional Institution Phoenix. He’s awaiting his final prison assignment.

A prison spokeswoman told The Post the ultimate goal is to integrate the 81-year-old into the general population.

Simpson, who was acquitted of murdering his wife, Nicole, and her friend Ron Goldman, said the disgraced TV star would be better suited to house arrest.

“With his health and his age and the nature of the crime, there’s not a warden in this country wants the responsibility of a Bill Cosby,” Simpson said.

Music superstar Stevie Wonder is also grappling with the idea of “America’s Dad” behind bars.

“I don’t like prisons,” the musician told TMZ. “I respect the work that he’s done in his career as an artist. He’s inspired a lot of people and I just pray God will give him mercy.”

But, he added, “Every woman should be protected.”

This story originally appeared in the New York Post.