Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Dealing with the point you raised in your question, the late Sheikh Sayyed Sabiq states in his well-known book, Fiqh As-Sunnah:
According to Abu Hanifah, Ahmad, Ishaq, and Abu Thawr, itikaf is valid in any mosque in which the five prayers are held and which has a congregation.
This is based on the hadith of the Prophet (peace and blessings be upon him): “Every mosque that has a caller to prayer and an imam is acceptable for itikaf.” (Ad-Daraqutni)
Imam Malik, ash-Shafi`i, and Dawud say that it is acceptable in any mosque, as there is no proof that restricts it to any particular mosque.
The Shaf`i followers say it is better to perform itikaf in a Jami mosque (in which the Jumuah prayer is performed), as the Prophet (peace and blessings be upon him) performed itikaf in such a mosque, and because the number of those who attend the prayers in such a mosque is greater.
Allah Almighty knows best.
Editor’s note: This fatwa is from Ask the Scholar’s archive and was originally published at an earlier date.