Plastic mats protect rugs from soil and wear in heavy-use areas such as entryways and halls. They also reduce the risk of furniture dents when used under office chairs. For best results, use a mat designed to stay put on a rug. These have small spikes molded onto the back that dig into the rug (without damaging the rug) to hold the mat in place. There are also mats with slip-resistant backing. If a plastic mat you already have moves on the rug, there's a remedy that may keep it in place.
Purchase some double-face carpet tape. This tape sticks on both sides to help secure the plastic mat to the rug. It's available at large hardware stores and from carpet retailers.
Undertake the mat securing project in the morning, when the house is cool. Some adhesives won't adhere in hot or humid conditions.
Clean the mat if it has been used, as soil or oily residues will defeat the tape's ability to stick. Use a mild soap and water solution. Rinse well and allow the mat to dry completely. Chemical products might leave a residue that would damage the tape.
Place the mat upside down. Use a covered table or counter for this if you prefer to have it at a convenient height instead of on the floor. Unroll the tape along one end of the mat. Cut the tape so it will be the width of the mat (the short direction, rather than lengthwise).
Remove the backing from one side of the carpet tape an inch at a time and press the adhesive firmly to the mat a 1/2-inch from the edge along one end. Repeat with another strip of carpet tape on the other end of the mat.
Turn the mat over. Remove the backing from the second side of the carpet tape on both ends of the plastic mat. Place the mat right side up on the rug. Adjust the position to where you want it. Apply pressure all along the tape on both ends.