In the middle ages, the Emperor was in the habit of Katachigae (a practice of approaching a destination in a different direction than going directly from one's house) for fear of onryo every time he passed through the neighborhood of Mikoshi-gosyo in Gion.
天皇は中世には祇園の御輿御所近くを通る際にはその怨霊を恐れて方違を行う慣例がありった。