Strengthening the piriformis muscle itself and also the other hip abductor muscles can be helpful in preventing piriformis syndrome recurring.
Stand with one end of the band tied around the ankle and the other end attached to a fixed object, close to the floor. Move the leg out to the side, away from the body, keeping the knee straight. Once you get as far as is comfortable, slowly return the leg back to the center. Repeat 15 times and gradually build this up to 2 sets of 20 reps.
Play hip abduction exercise video.
Lay on your side with the hip to be worked on top. Bend your knees and position them forwards so that your feet are in line with your spine. Make sure your top hip is directly on top of the other and your back is straight. Keeping the ankles together, raise the top knee away from the bottom one.
Remember, don't move your back or tilt your pelvis, all the movement should be coming from the hip. Slowly return it to the starting position. Repeat 15 times initially and gradually build this up to 2 sets of 20.
Play clam exercise video.
Position yourself on all fours. Shift your weight slightly off the leg to be worked. Keeping the knee bent, raise the knee off the floor so that the sole of the foot moves towards the ceiling. Slowly lower the leg, almost back to the starting position and repeat. Repeat 15 times initially and gradually build this up to 2 sets of 20.
Play hip extension exercise video.