Long-duration gamma-ray bursts (GRBs) and X-ray flashes (XRFs) are produced by highly relativistic jets ejected in core-collapse supernova (SN) explosions. The origin of short hard gamma-ray bursts (SHBs) has not been established. They may be produced by highly relativistic jets ejected in various processes: mergers of compact stellar objects, large-mass accretion episodes onto compact stars in close binaries or onto intermediate-mass black holes in dense stellar regions, phase transition in compact stars. Natural environments of such events are the dense cores of globular clusters, super star clusters and young SN remnants. We have used the cannonball model of GRBs to analyze all Swift SHBs with a well-sampled X-ray afterglow. We show that their prompt gamma-ray emission can be explained by inverse Compton scattering (ICS) of the progenitor's glory light and their extended soft emission component by either ICS of high-density radiation or synchrotron radiation (SR) in the high-density medium within the star cluster. The mechanism generating their afterglow is SR outside the cluster. No associated SN could be detected in the low luminosity nearby GRBs 060614 and 060505. We interpret them as SHBs seen relatively far off-axis.