Restrict to wp-login.php for users

Generally we need to restrict our wordpress site users to acess wp-login.php, here is the code to accomplish this. Put this code into your themes functions.php and general users are restricted.

I'm a web developer / PHP programmer. I am also working on custom plugin development of wordpress.