Updated

The U.S. military's European Command said Tuesday it has ordered its troops to avoid wearing their uniforms when off base, and to ensure the security settings and geolocation functions on their social media pages aren't "overly revealing."

EUCOM spokesman Navy Capt. Greg Hicks would not say what prompted the new directive for the roughly 70,000 U.S. personnel serving in Europe. The order, issued Nov. 10, comes after high-profile attacks on soldiers of American allies Britain and Canada in their home countries.

"We continually assess threats to our forces with and alongside our host nation counterparts, and take appropriate measures based on those assessments," Hicks said in an e-mailed statement to The Associated Press. "We will not get into the specifics of those threats nor the assessments."

EUCOM said it did not know whether other American commands had issued similar directives.

The order came two days before three American sailors were assaulted in Istanbul, Turkey, near where their warship was docked.

Protesters shouted "Yankee, go home!" and other slogans, and threw red paint at the sailors, who were not in uniform. They also briefly succeeded in putting white sacks over the sailors' heads.

Last month, a gunman shot and killed a soldier in Ottawa in an attack Prime Minister Stephen Harper called an act of terrorism.

Two days before that, a man authorities said was inspired by the Islamic State extremist group ran over two soldiers in a parking lot in Quebec, killing one and injuring the other before being shot to death by police.

The attacks raised fears Canada was suffering reprisals for joining the U.S.-led air campaign against IS in Iraq and Syria.

Last year in the London suburb of Woolwich, two Islamic extremists ran a British solder down in a car, then stabbed and hacked him to death in public. One of the men accused in the crime has said they choose the first soldier they spotted, and considered him a "fair target."