The French administrator of Morocco , General Hubert Lyautey , decided to move the country 's capital from Fez to Rabat . The French administrator of Morocco , General Hubert Lyautey , decided to relocate the country 's capital from Fez to Rabat .