Columbia Pictures' chief Harry Cohen was very protective of the studio's most valuable asset in the mid-1940s, his contract star Rita Hayworth. Perhaps Cohn recognized the unique appeal of Hayworth, who was equally popular with both male and female moviegoers. Cohn fashioned pictures tailored to his star, and did not hesitate to hire women in key behind-the-scenes roles. Virginia Van Upp was a screenwriter who specialized in musicals and comedies, with such films to her credit as Poppy (1936), Honeymoon in Bali (1939), and One Night in Lisbon (1941). In 1944 she cowrote the screenplay for the Rita Hayworth vehicle Cover Girl, costarring Gene Kelly and directed by Charles Vidor. It was an enormous success, and following it, Harry Cohn assigned Van Upp to a production position; she became one of the few women in Hollywood's Golden Age to become a producer. In her first year in the position she wrote or co-wrote and produced three comedies for Columbia, each featuring a strong female lead: The Impatient Years (1944) with Jean Arthur, Together Again (1944) with Irene Dunne, and She Wouldn't Say Yes (1945), starring Rosalind Russell. Cohn assigned Van Upp to fashion a sexy new film for Rita Hayworth. Hayworth had become a leading pinup girl with U.S. soldiers overseas, and it was logical that with the end of the war, they would be clamoring to see her on the screen.

Gilda was originally conceived strictly as a drama, with no musical numbers. Initial thought was given to shooting the film in Technicolor, but as too many of the specialized cameras were already tied up with other projects, Cohn easily accepted the black-and-white option and hired cinematographer Rudolph Maté to shoot the picture. Maté was the Director of Photography on such earlier color Hayworth films as Cover Girl and Tonight and Every Night (1945). The original story credit for Gilda is credited to E. A. Ellington, and while the adaptation is by Jo Eisinger and the script itself is credited solely to Marion Parsonnet, in all probability Van Upp also contributed to the final screenplay. Initially the story had an American setting, but it was quickly realized that the Buenos Aires setting allowed for a more sordid set of circumstances. Gilda shares many similarities in story structure and setting with Casablanca (1942), and it also shares with that film an awkward honor: the script was not yet finished when filming began. As choreographer Jack Cole was quoted as saying in John Kobal's People Will Talk, "The script pages would arrive practically the morning that we were going to shoot, they were making the picture up as we went along. If you really look, you can tell that was the way the picture was done because it doesn't really make any sense if you try to follow the story."

The leading man role in Gilda was not cast until the last moment. Glenn Ford had been away in the service, where he rose to the rank of Captain in the Navy. He had not appeared in a film since 1943's Destroyer, but was still under contract to Columbia, so was a natural to cast in the complex role of Johnny. In the years since Gilda's release, many have noticed the strong indication in the final lines and situations of a homosexual undercurrent existing between Ford's character and George Macready's character. Upon hearing of the interpretation, director Vidor reportedly said, "Really? I never had any idea those boys were supposed to be like that!" Glenn Ford has also acknowledged the gay subtext, "But it never occurred to us at the time we were filming."

by John Miller