Just check this plugin and you will see how that can be achieved:
https://github.com/pupi1985/q2a-ultimate-seo