Currently this will strip www. from any URL. This may change the affect, as www.example.com and example.com could resolve to different IP addresses.

Could you explain your reasoning for doing this?