"Foreigners must respect Chinese laws while in China and must not harm China's national security or damage the social order," a legal guide for foreigners posted on the Beijing Olympic Organising Committee's official website in Chinese said.
The list of instructions for the visitors includes measures to ensure that public hygiene and social order are maintained during the summer sporting event.
"To maintain the public hygiene and civilized image of cities, sleeping outdoors is banned in such public venues as airports, bus stations, piers, sidewalks and urban greenbelts," it said.
China, which expects 500,000 overseas visitors to Olympics, has identified terrorism as the "biggest threat" to the event, prompting authorities to ramp up security with a wide range of measures.
More From This Section
The guide said foreigners who had bought Olympic tickets "will not automatically get a visa to enter China."
"They still need to go to Chinese embassies and consulates and apply for visas according to related rules," it said, according to state-run Xinhua news agency.
"Those who are believed to be likely to carry out terrorist, violent or subversive activities are not allowed to enter China," the guide whose English version would be available soon, said, according to Xinhua.
Displaying insulting slogans and banners in sports venues and of those regarding religion, politics and race at the Olympic venues is also prohibited, it said.