The Forbidden City and the Palace of Versailles are residences of the Emperors and their royal families. They are the most spectacular buildgings in their capitals. However, they were constructed in different parts of the capitals, with the Forbidden City being built in the centre of Beijing and the Palace of Versailles being built in the suburb adjacent to the inner city of Paris.
It is the traditional Chinese characterisitic of urban planning, with the Palace constructed in the city centre, as the main structure of the capital, in order to control and rule the city better. However, with such a "big obstacle" placed in the middle of the city, the transportation from west to east was seriously affected since citizens in the west of the city couldn't pass through the Forbidden City to go to the east directly.
Louis XIV abandoned the Palace of Louvre, in the inner city of Paris and had the new palace built in the Versailles. His action could not be clearly explained. Some suggest that he chose the location because the isolation of Versailles from the city centre had a symbolic value in representing the unique position of the monarch. Another suggestion is that garden was important in the eyes of Louis XIV, so he chose to build his residence in Versailles, which was a suburb with a large space for the expansion of gardens and parks.
In conclusion, the location of the Forbidden City in China was largely due to the traditional value in urban planning. On the other hand, the location of the Palace of Versailles was possibly owing to the personal will of the King.