I use the driver program of my mouse to do it. In my case, I have a rather old logitech mouse (MX1000, part of a set, but just use the mouse now). I had to use a tweaked-version of my driver thanks to "uberoptions". Google it and you'ill find it in case you use a logitech mouse too.
In any other case, if your mouse is recent enough, any decent driver should allow you to reassign the commands of the side-buttons.
Thanks I have a Logitech M500 (I believe, gotta check and make sure). Appreciate the response.