Silicone acetate.
(bathroom sealant that smells like fish and chips, (vinegar) not of ammonia (stale piss.... )
spread it liberally in lines across the area to be covered, then put the rug down on it and weight it down....
(as long as we're talking thick non high value rugs)
once it cures the rug will stay fixed in place, but can be peeled off later without damaging the floor.
if you object to the back of the rug being covered in the stuff, ( it does NOT easily come out of fabrics)
a smart move is to use a backing rug , of something heavy that won't let it bleed right through while curing, with strips of velcro around the edges if necessary, and the posh rug on top....
or you can just lay it on top, it will at least not go flying so easily.
you get the idea by now i'm sure....
i use the stuff regularly for work, fixing open cell foam panels to walls and ceilings, as well as rugs to floors.....
it still peels off after several years with not too much trouble.... but doesn't peel off by itself just to annoy you..... usually even if you get it wet.