I want to use a hdri just for the light and i want to change the color of the background in white.How can I do that ?
A flexible way would be to use compositing, as shown here. That would let you change the background to anything you like, at later stages.
A more destructive way is to use a Light Path node in the World's node tree:
(Select 'World' in the Node Editor's header, as opposed to 'Object')
With HDRI background visible to camera:
There are 2 easy ways of doing that. In both cases you need to set "Transparent" in Film render properties. Then you can spread a white plane behind the scene (switching off all Ray Visibility Cycles settings except Camera) or use Alpha Over node in Node editor and drop the render result over the white color.