The national flag of Morocco was originally plain red, but the seal of Solomon device was added in 1915 at a time when the army was being modernized by the French.
Morocco has been ruled by the Hassani dynasty since 1649 but has not flown a national flag from Moroccan flag poles until modern times really.
From the year 1912 to about 1956 the country was divided into French and Spanish protectorates and the international city of Tangier. All of these had their own flags for internal and external use.
The plain flag with the green pentacle was for use inland only, but it became the national flag when independence was restored in 1956. In the then following year Morocco became a monarchy, and some 2 years later adopted a coat of arms, which shows the sun rising over the Atlas Mountains, the green pentacle and the royal crown.
This flag is available for purchase here.