We have a mosque that was not accurately oriented toward the correct Qiblah. The Imaam faces a certain direction, while the worshippers behind him are facing another direction. Is this permissible?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Muslim scholars agree that facing the direction of the Qiblah is one of the due conditions for the validity of the prayer. A worshipper who directly sees the Ka‘bah should direct himself towards its direction exactly. A person who is far and unable to see the Ka‘bah itself is obliged to face its general direction. He turns his face towards the direction of the Ka‘bah and not exactly facing its body. The Prophet, sallallaahu ‘alayhi wa sallam, said: "The Qiblah is between the East and the West." [Ibn Maajah and At-Tirmithi; Saheeh]
This is the case when the worshipper is standing south or north of the Ka‘bah. However, if he is standing east or west of the Ka‘bah, the correct direction of the Qiblah is between north and south.
As for what you have mentioned about the deviation of the congregation from the direction of the Qiblah that is faced by the Imaam, if this deviation is insignificant, there is no harm in it. However, it is better to re-orient the mosque accurately towards the Qiblah so that all the worshippers will be facing the correct direction of the Qiblah. If the deviation from the Qiblah was significant in a way that one is completely turned away from the Qiblah, the prayer is invalid. Hence, in such a case, you should correct the inaccurate Qiblah orientation or the worshippers should direct themselves towards the correct direction by making signs on the carpets or the like. This is so that all the worshippers will align side-by-side and face the correct direction of the Qiblah.
You can search for fatwa through many choices