I visited mosques all over Turkey. Dress modestly, remove shoes, wash face and hands, and I only went in when prayers were not being said (not required, my preference).
Non-Muslims may not go into mosques in Mecca and Medina.... that's OK, I won't be visiting Saudi Arabia anytime soon.
The Aya (San) Sophia in Istanbul (Constantinople) is a spectacular sight to behold. First Christian church under Rome (emperor Constantine), later an Ottoman mosque. Many but not all signs of Christianity were defaced or removed. The place is now more a museum under rehabilitation and not an active mosque.
http://en.wikipedia.org/wiki/Hagia_Sophia


