From Wikipedia:
Unless the Civil War takes place at different dates in the Dollars trilogy, that one has to be a prequel.The Good, the Bad and the Ugly is considered a prequel, since it depicts Eastwood's character gradually acquiring the clothing he wears throughout the first two films and because it takes place during the American Civil War (1861–1865), whereas the other two films feature comparatively more modern firearms and other props. For example, Lee Van Cleef's character in For a Few Dollars More appears to be a Confederate veteran who has come down in the world, and a graveyard scene in A Fistful of Dollars features a gravestone dated 1874.
You should see me talk about the World Between Worlds in Star Wars.