Narrated Ibn ‘Umar:
The Prophet said, “A woman should not travel for more than three days except with a Dhi-Mahram (i.e. a male with whom she cannot marry at all, e.g. her brother, father, grandfather, etc.) or her own husband.)”
The Prophet said, “A woman should not travel for more than three days except with a Mahram.”
Narrated Abu Huraira:
The Prophet (p.b.u.h) said, “It is not permissible for a woman who believes in Allah and the Last Day to travel for one day and night except with a Mahram.”
The saheeh (authentic) Sunnah indicates that it is not permissible for a woman to travel except with a mahram. This travelling is not defined by a specific distance, as is the case with shortening the prayers or breaking the fast, rather everything that is called travelling, whether it is long or short, is not permitted for a woman unless she has a mahram with her.
Al-Bukhaari (1729) and Muslim (2391) narrated that Ibn ‘Abbaas (may Allaah be pleased with him) said: The Prophet (peace and blessings of Allaah be upon him) said: “No woman should travel except with a mahram.”
The fuqaha’ are unanimously agreed that it is haraam for a woman to travel without a mahram, except in a few exceptional cases, such as travelling for the obligatory Hajj, for which some of them have permitted a women to travel with trustworthy companions. Al-Haafiz Ibn Hajar (may Allaah have mercy on him) said: al-Baghawi said: They did not differ concerning the fact that a woman may not travel for anything but the obligatory Hajj except with a husband or mahram, except a kaafir woman who becomes Muslim in daar al-harb or a female captive who escapes. Others added: or a woman who becomes separated from her group and is found by a trustworthy man, in which case it is permissible for him to accompany her until he brings her back to her group. End quote from Fath al-Baari (4/76).
For a very detailed and satisfactory answer, including the wisdom and reasons behind this ruling, read this.
Narrated Yahya bin Ishaq:
I heard Anas saying, “We travelled with the Prophet from Medina to Mecca and offered two Rakat (for every prayer) till we returned to Medina.” I said, “Did you stay for a while in Mecca?” He replied, “We stayed in Mecca for ten days.”
Distance between Makkah and Madinah = 338.9 km (approx.)
The majority of scholars defined the distance at which a traveller may shorten his prayers; and some of them did not set a limit, rather they left that to be decided by custom (al-‘urf) – what is customarily regarded by the people as travelling is where the concession is granted allowing the traveller to shorten his prayers and break his fast.
According to the majority of scholars, the distance is defined as being approximately eighty kilometers.
It says in Fataawa al-Lajnah al-Daa’imah (8/99): The distance in which the concession of traveling is allowed is that which is customarily regarded as travelling, which is approximately eighty kilometers. Whoever is going to travel this distance or more is allowed to avail himself of the concessions granted to travellers, namely wiping over the socks for three days and nights, and joining and shortening prayers, and not fasting in Ramadaan.
..And there is no difference between travel by land or by sea.
[Taken from IslamQA]
So travelling within a city or close by does not mean you can shorten prayers. Minimum distance defined above.
Narrated Said bin Yasar:
I was going to Mecca in the company of ‘Abdullah bin ‘Umar and when I apprehended the approaching dawn, I dismounted and offered the Witr prayer and then joined him. ‘Abdullah bin ‘Umar said, “Where have you been?” I replied, “I apprehended the approaching dawn so I dismounted and prayed the Witr prayer.” ‘Abdullah said, “Isn’t it sufficient for you to follow the good example of Allah’s Apostle?” I replied, “Yes, by Allah.” He said, “Allah’s Apostle used to pray Witr on the back of the camel (while on a journey).”
Narrated Ibn ‘Umar:
The Prophet used to offer (Nawafil) prayers on his Rahila (mount) facing its direction by signals, but not the compulsory prayer. He also used to pray Witr on his (mount) Rahila.
1. Prophet (SAW) used to pray witr while traveling. Meaning, even while you’re shortening the prayers in your travel, you still pray the witr prayer.
The majority of scholars (jumhoor ul-‘ulmeaa’) assert that salaat ul-witr (witr prayer) is a sunnah mu’akkada (confirmed sunnah that the Prophet peace be upon him, practiced consistently), and that it is not obligatory. This is based on the hadith (saying) regarding the bedouin who once came to the Prophet asking about Islam, the Prophet answered, “Five prayers within one day-and-night.” The bedouin asked, “Am I obliged to other than those?” The Prophet replied, “Unless you volunteer of your own.” (al-hadith muttafaqun alaih.)
Some scholars have said that qiyaam ul-layl (prayer at the heart of night) and salaat ul-witr are the best of the voluntary prayers (al-nawaafil). Therefore, one should consistently practice them and not neglect them. The Prophet did not neglect the prayers during night nor two rak’ah before al-fajr neither in residence nor in travel (as related in al-sunnah al-sahihah).
2. He (SAW) used to pray witr on the mount (camel). Meaning, you need not get off your car in order to pray witr.
Ibn ‘Umar (may Allaah be pleased with him) said:
“The Prophet (peace and blessings of Allaah be upon him) used to pray voluntary (nafl) prayers when riding on his camel, no matter what direction it was facing, when he came from Makkah to Madeenah.” Then Ibn ‘Umar recited this aayah (interpretation of the meaning): “And to Allaah belong the east and the west, so wherever you turn yourselves or your faces, there is the Face of Allaah (and He is High above, over His Throne)…” [al-Baqarah 2:115]
Ibn ‘Umar said: “It was concerning this that this aayah was revealed.” (Reported by al-Tirmidhi, 2883; he said, this is a saheeh hasan hadeeth)
And it (facing qiblah direction) does not apply to one who is praying a naafil prayer or witr prayer whilst riding on a riding-animal etc., but it is.. mustahabb for him to face the qiblah if he is able to do so when pronouncing the takbeer of ihraam (at the beginning of the prayer), then he may face whatever direction he is facing.
*The awkward moment when you can’t seem to make your keyboard type English from left to right* :/