'Posts and Tags with the same base slug

My posts are sorted by categories in my wordpress website

I've a main category named blog

The urls of my posts are as follows :

http://example.com/blog/post-1

http://example.com/blog/post-2

I also use Wordpress tags, I would like their urls to have the same base slug as posts like this :

http://example.com/blog/tag-computer

http://example.com/blog/tag-medecine

I would like the main category slug to be the base slug for the tags

How Wordpress Can Tell the Difference Between Posts and Tags, I might use template_redirect hook. But i would like your opinion

Thanks !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source