Ankylosing spondylitis (AS) is an inflammatory condition that can cause the ligaments, joint capsule, and tendons that attach to your spine to swell (enthesitis). Over time, this can lead to bone formation and possible fusing of the vertebrae. This type of arthritis can result in a loss of flexibility.
The good news is that regular exercise — even 5 to 10 minutes each day — can increase flexibility and strengthen muscles that support your back and neck. Practicing good posture techniques also can help you look and feel much better.
Sleeping posture: Sleep with your spine straight, if possible. To encourage this position, your mattress should be firm, but not too hard. Sleep on your stomach if you can, and don’t use a pillow. Alternatively, you can sleep on your back and use a thin pillow, or one designed to support your neck. Avoid sleeping with your legs curled and keep them as straight as you can.
Lying posture: You should perform this exercise on a firm surface. Use your bed if it has a firm mattress, or place a mat on the floor. Lie face down for 15 to 20 minutes. (If you can’t do this comfortably, you may use a pillow under your chest and place your forehead on a folded towel.) You may keep your head downward, turn it to one side, or alternate sides.
You may not be able to do this for 20 consecutive minutes. That’s fine. Begin with whatever feels comfortable and increase the time as you gain strength.
Swimming in general is a great way to increase flexibility in your spine without jarring it. It also helps to increase flexibility in your neck, shoulders, and hips. You may find it easier to perform aerobic exercises while in the pool.
Please also check this link for some exercises to address hip pain:
Before engaging in these exercises, please consult your doctor if these are safe for your Ankylosing Spondylitis.