All wards at Cheltenham General Hospital have been closed to visitors following an outbreak of norovirus.
A number of staff and patients have contracted the illness, which causes diarrhoea and vomiting.
As a precautionary measure the hospital is asking people not to see patients unless visiting on compassionate grounds.
"Access arrangements will be reviewed on a daily basis and will be lifted when appropriate," a spokesman said.
"Visitors to children's and maternity wards is limited to partners, parents and carers.
"However anyone who has had any symptoms of sickness, diarrhoea or flu-like symptoms is asked not to visit until free from them for at least 72 hours.
"Access to ward 4B at Gloucestershire Royal Hospital in Gloucester is also affected," the hospital spokesman added.
Outpatient appointments at both the trust's hospitals is unaffected by the visitor ban.