Iranian President Mahmoud Ahmadinejad is unhurt by a blast near his motorcade in the western city of Hamadan.