Follow @AhleDhikr
This was the same approach taken by the Companions (Allah be Pleased with them) during the time of Umar bin al-Khattab (Allah be Pleased with him) when the plague of Amwas afflicted them in Sham where a large number of people were afflicted and it resulted in a lot difficulties. Amr bin al-'As (Allah be Pleased with him) was made responsible and he commanded that the populous leave the urban living area and move into the valleys and the mountains. As a result of this, the Salat in the Masjid were forfeited and likewise Salat al-Jumuah. They took this action as a way to repel the pandemic - with the Permission of Allah, the Glorifed and Exalted -. This then reached the leader of the believers Umar bin al-Khattab (Allah be Pleased with him), and he didn't disapprove of the action and he didn’t reject it either. Rather, he approved of these measures and this was one of the approaches they took to have the pandemic lifted.
-Shaykh Sa'd ash-Shathri, Member of Panel of Senior Scholars and Permenant Committe of Fatwa and Research
https://www.youtube.com/watch?v=wzyupIFNAAs&app=desktop