'Remove domain.com from the URL

Does anybody know how to remove the domain from the URL when redirecting through a taxonomy?

I've created a custom taxonomy on wordpress that I use in my online shop. When I click on it, it redirects me to the archive page. I've rewritten the taxonomy slug in order to be redirected where I need to but in order for this to completely work I need to remove the domain.com in the URL.

Example: domain.com/category/product

what I need is:

/category/product



Sources

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

Source: Stack Overflow

Solution Source