I believe there are several ways to protect a rape victim who testifies at trial while also protecting the rights of the accused, who is presumed innocent until found guilty in a court of law.
Close the courtroom: The judge allows the victim to testify with only court personnel, attorneys, the jury and the defendant in the courtroom. The public, including reporters, are barred from being in the room while the victim is on the witness stand.
Closed-circuit testimony: Rather than have the victim on the witness stand, she is allowed to testify from the safety of another room, with the prosecutor, defense attorney and judge present. The jury and people in the courtroom view the proceedings over closed-circuit television.
Put up a barrier: The victim testifies from behind a screen set up in front of the witness stand so that she does not have to see the defendant as she speaks. However, this would require the overturning of Coy v. Iowa, a Supreme Court decision that disallowed this method of testimony—a precedent that, in light of further understanding of rape trauma, should be reconsidered.