There are plenty of exercises for AS available on-line (focus on stretching & strengthening exercises), but by far best thing is to book few session with physiotherapist with the experience in treating patients with AS. Recommended accessories: exercise ball (big and small), yoga mat, black roll, theraband (elastic band for stretching).
Some exercises that can be found online:
https://www.youtube.com/watch?v=-_Ud92aLTco&t=314s
https://www.youtube.com/watch?v=Pz0WR3EKO1k
https://www.youtube.com/watch?v=9sUVYOgladE
https://www.youtube.com/watch?v=aCWCm5F7kNE
http://healthblogs.online/2017/02/23/ankylosing-spondylitis-some-useful-exercises/
http://www.healthline.com/health-slideshow/ankylosing-spondylitis-exercises
http://www.webmd.com/arthritis/conditioning-and-strengthening-exercises-for-ankylosing-spondylitis
http://www.arthritisresearchuk.org/arthritis-information/conditions/ankylosing-spondylitis/self-help-and-daily-living/exercise.aspx
http://www.everydayhealth.com/ankylosing-spondylitis-pictures/ways-to-ease-ankylosing-spondylitis-pain.aspx
sacroilliac joints:
https://www.youtube.com/watch?v=CXH5SEI_AsM;
https://www.youtube.com/watch?v=_u0mJl8RqXI;
https://www.youtube.com/watch?v=h7zQhxoTSWw;
https://www.youtube.com/watch?v=cTo1eAZXNKk;
https://www.youtube.com/watch?v=BFXTmtXIVGw
Make sure your pelvis doesn't move when you're doing exercises and don't forget to breathe.