Lithium-sulfur battery, one of the most promising rechargeable electrochemical systems, has suffered several technical obstacles, such as rapid capacity fading and safety concerns. The former mainly result from the “shuttle” mechanism due to the dissolution of the reaction intermediates lithium polysulfides; the latter can be attributed to the highly flammable electrolyte. To overcome these problems, we prepared a series of Li-S battery electrolytes based on ionic liquid of (N-methoxyethyl-N-methylpyrrolidinium bis (trifluoromethanesulfonyl)-imide, P1,2O1TFSI) and cosolvents of tris(ethylene glycol) dimethyl ether (TEGDME) with lithium bis (trifluoromethanesulfonyl)-imide (LiTFSI) as lithium salt. The electrolyte provides a counterbalance between shuttle suppression and solubility of lithium polysulfides by combining the ionic liquid and TEGDME in the optimum mass ratio of 7:3. The 0.4molkg−1 LiTFSI-P1,2O1TFSI/(30wt%) TEGDME electrolyte exhibits good ion transport (room temperature ionic conductivity of 4.303mScm−1) and safety (self-extinguishing time of 4.8sg−1). The Li-S batteries with the 0.4molkg−1 LiTFSI-P1,2O1TFSI/(30wt%) TEGDME electrolyte possess the high discharge capacity (1212.8mAhg−1 for the first cycle at 0.1C), excellent rate capability (886.5mAhg−1 at 1C) and good cycling performance (capacity retention of 93.3% after 100 cycles with the coulombic efficiency above 95% at 1C). Moreover, this electrolyte could operate at 80°C in Li-S cells indicating the excellent high temperature performance. This research gives a new insight for designing ionic liquid-based electrolyte for the safe Li-S batteries with high performance.