The recipe is exactly as I said. It takes a magic item and rerolls it with the same ilvl. So blue weapons, blue armours, blue rings, blue amulets, blue charms and blue jewels would all work, but yellow/green/white/orange/gold/grey items won't.
Rare items cannot be rerolled per se. There's no recipe that will retain the ilvl of a rare item and just get new affixes.
There is the recipe 6 perfect skulls + rare item = new rare item of same type. However, the ilvl of the output item is equal to floor(.4 * clvl) + floor(.4 * ilvl). This means that the ilvl could decay with repeated use. If you start out with an ilvl 99 item and reroll repeatedly with a clvl 99 character, it'll eventually drop to ilvl 65. If your clvl is lower than 99, it'll drop even more.
There's also the 1 perfect skull + 1 SoJ + rare item = new rare item of same type recipe. This has ilvl equal to floor(.66 * clvl) + floor(.66 * ilvl). So the ilvl there is more favourable; any high-level character could eventually get an item to ilvl 99. However, it's not feasible to do this with legitimate items.
Rare items cannot be rerolled per se. There's no recipe that will retain the ilvl of a rare item and just get new affixes.
There is the recipe 6 perfect skulls + rare item = new rare item of same type. However, the ilvl of the output item is equal to floor(.4 * clvl) + floor(.4 * ilvl). This means that the ilvl could decay with repeated use. If you start out with an ilvl 99 item and reroll repeatedly with a clvl 99 character, it'll eventually drop to ilvl 65. If your clvl is lower than 99, it'll drop even more.
There's also the 1 perfect skull + 1 SoJ + rare item = new rare item of same type recipe. This has ilvl equal to floor(.66 * clvl) + floor(.66 * ilvl). So the ilvl there is more favourable; any high-level character could eventually get an item to ilvl 99. However, it's not feasible to do this with legitimate items.