Pains can be extremely complex.
Often times the area of the pain is not actually the area of injury.
This is especially common with the low back and hips.
Hip pathologies can refer pain into the knee, leading people to believe they have a knee issue.
Too many times I have seen a referral from the low back (lumbar radiculitis or radiculopathy) that causes pain in the hamstring.
This is deceptive because people try to pursue treatment, stretching, and strengthening for the hamstring.
It is important to figure out the area of pathology and cause of the pain in order to solve it.
Areas that can cause pain in the back of the leg:
Lumbar nerve (nerve from the low back)
Hamstring: From the muscle itself
Hip: Pain can refer from the hip down to the back of the leg
Knee: Knee pain can refer into the back of the leg especially into the calf and lower hamstring region
Gluteal muscles: Pain can refer down from the glute and deep hip muscles to refer down into the right hamstring
Find a good physical therapist, osteopath, or physiatrist that can assess you in order to guide your treatment.