In addition to the other answers: during Ramadan we were not allowed to enter Temple Mount.
Jerusalem is no longer divided (it was divided between Jordan and Israel between 1948 and 1967). Israel controls all of it, and there are no check points or border control anywhere in the city.
There are security checkpoints at the entrance to the Temple Mount, but they’re there to keep the Israelis (and weapons) out, not the foreigners (as opposed to what you might have heard, even though Israelis control all of the city, it is the Israelis, Jews in particular, who are banned from the Temple Mount). Most tourist can get in without a problem. Dress accordingly. On Friday’s, religious holidays or when there’re some occasional security tensions and alerts, some restrictions may be in place (usually for the Israeli/Palestinian Muslims coming to pray, but may also affect tourists).
The yellow capped building is not the Al Aqsa mosque, its the Dome of the Rock and it’s not a mosque at all. Al Aqsa mosque is the gray and unattractive building in the corner of the Temple Mount compound, right on top of the Western Wall.
The Dome of the Rock is located on the Temple Mount. The Temple Mount is located in the old city of Jerusalem. The Temple Mount can be visited and you don’t need a special permit for this.
There are a couple of gates in the old city of Jerusalem. All the gates are controlled by the Israeli police. These are security checks. However If you are not a Muslim you do have to enter the site through the “Bab al-Maghariba”. This gate is located on the Western Wall Plaza. In fact if you are standing in front of the Western Wall, it is the covered bridge you can see on your right hand side. You have to pass through metal detectors and bags are x-rayed. Note that you can exit the Temple Mount through one of the other gates.
The Temple Mount is a highly religious site. Thus some decent dress is required.
Credit:stackoverflow.com‘