Can You Drive to the Mosque Instead of Walking?
Question

Does going to the mosque riding bring the same reward as walking?.
Praise be to Allah.Reward for walking to mosques 
It should be noted that it is narrated that there is a great reward for walking to the mosque , and that the worshippers who will have the greatest reward are those whose houses are further away.  
Abu Hurayrah (may Allah be pleased with him) narrated that the Messenger of Allah (peace and blessings of Allah be upon him) said: "Shall I not tell you something by means of which Allah erases sins and raises people in status?" They said: Yes, O Messenger of Allah. He said: "Doing Wudu properly at times when it is difficult to do so, taking many steps to the mosque, and waiting for prayer after prayer. That is constant readiness." (Narrated by Muslim, 251) 
Abu Musa (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “The people who will receive the greatest reward for prayer are those who walk the furthest distance to come and pray, then those who walk the next furthest.” (Narrated by Muslim, 662) 
This Hadith and the one before it point to the virtue of living far from the mosque , so that one may take more steps, which will bring reward, the abundance of which depends on how far away one's house is, as well as how often one comes to the mosque.  
Ubayy ibn Ka`b (may Allah be pleased with him) said: There was a man, and I do not know of any man who lived further away from the mosque than he did, but he never missed a prayer. It was said – or I said – to him: Why don’t you buy a donkey that you can ride when it is dark or when the sand is too hot? He said: I would not like my house to be next to the mosque. I want my walking to the mosque and my returning when I come back to my family, to be recorded for me. The Messenger of Allah (peace and blessings of Allah be upon him) said: “Allah has gathered all that (reward) for you.” (Narrated by Muslim, 663) 
Look at this great reward from our generous Lord. The Hadith indicates that the reward is given for the steps taken when returning from the prayer as well as when coming to it. Hence this Companion preferred to walk on foot despite the fact that his house was so far from the mosque . 
Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever purifies himself in his house then walks to one of the houses of Allah in order to perform one of the duties enjoined by Allah, for every two steps he takes, one will erase a sin and the other will raise him one degree in status.” (Narrated by Muslim, 666)
Buraydah Al-Aslami (may Allah be pleased with him) narrated that the Prophet (peace and blessings of Allah be upon him) said: “Give glad tiding to those who walk to the mosque in darkness, of perfect light on the Day of Resurrection.” (Narrated by Abu Dawud, 561; classed as authentic by Al-Albani in Sahih Abu Dawud) 
It says in Dalil Al-Fatihin (3/558-559): “Darkness here refers to the darkness at the time of ‘Isha’ and Fajr. This Hadith points to the virtue of walking to prayer whether it is a long walk or a short one, and the virtue of walking to pray in congregation in the darkness of the night.” 
This virtue is assured – in sha Allah – for the one who prays `Isha’ and Fajr in congregation , even if the way is lit, because these two prayers take place in the darkness of the night.  
Can you drive to the mosque?
These Hadiths and others encourage the Muslim to strive to come to the mosque walking, not riding, even if his house is far away, so long as it does not cause hardship and he does not have an excuse such as being old and so on, and he should not accustom himself to travelling by car if the mosque can be reached on foot without difficulty. 
Benefits of walking to the mosque
In addition to these great virtues of walking to the mosque – namely that sins are erased, being raised in status, great reward and perfect light on the Day of Resurrection – there are other important benefits for the body: 
·         Walking to the mosque is a form of exercise in and of itself, which brings innumerable benefits. It plays a major role in strengthening the body and giving energy, by Allah's leave, so that the person will become able to fight disease and sickness.  
·         Walking to the house of Allah every day at certain times will suffice to train the muscles and improve one’s physical condition. Walking to the mosque also plays a role in protecting the body against diseases that are caused by inactivity and sitting too much, above all obesity, because walking helps to get rid of fat. 
·         Walking is also a remedy against heart disease, because it gives the heart – by Allah's leave – the ability to work hard and improve circulation. 
·         Walking to the mosque is also a remedy for mental exhaustion and thinking too much, because it restores the mind to its natural state and helps one to relax, physically and mentally. 
In conclusion, walking to the houses of Allah brings many health benefits, as explained by modern medicine. These are immediate benefits with which Allah blesses His believing slave in this world, when he responds to the call of Allah. And there is a great reward and perfect light in the Hereafter too, in sha Allah. (See Ahkam Hudur Al-Masajid, 60-62 – by Shaykh `Abdullah Al-Fawzan)
For more details, please see this category: Rulings on Mosques
And Allah knows best.