I have a magento site deployed at for example www.example.com and a test site deployed at test.example.com. To resolve cookie conflict between the domain and the sub domain, I was forced to make the Session Cookie management configuration like this: 
Now I am only able to login to admin via www.example.com/admin If I write example.com and try to login, I can not login. So, I want to add 'www' to the admin url automatically if the user does not add that to the url.
How that can be achieve. Any help in this regard will be much appreciated.