A conventional fez is a felt headpiece in the shape of a short cylindrical peakless hat and is usually red, sometimes with a tassel attached to the top.
In the early 19th century, Ottoman Sultan Mahmud II's main goal was to modernize the military by adapting Western-style uniforms with the addition of the fez as a headpiece.
Aladdin's signature outfit in the movie is a pair of loose, baggy pants, a small vest that he put on his naked upper body, and a small fez on his head.