Haloesterification of diverse diols with various carboxylic acids was achieved using potassium halides (KX) as the only halide source in ionic liquids. The best yield was obtained in [BMIM][PF6] when 1,2-octanediol, palmitic acid and KBr were used. This yield was 85% and the regioisomer with the bromine in primary position was present in a 75:25 ratio. The regioisomeric ratio could be improved using either KCl or some phenylcarboxylic acids. [BMIM][PF6] acts as both reaction media and catalyst of the reaction. To the best of our knowledge, this type of combined reaction using an ionic liquid is unprecedented. The other solvents tested did not lead either to the same yield or to the same regioisomeric ratio.