I want to redirect every users page to front page? like if user page url is /user/97 then it redirect to front page if user is not administrator. I want user page inaccessible to other users but only administrators.

Pretty easy to do with code, there is also Rules, and a handful of contributed modules that provide this.
– KevinNov 9 '18 at 20:59

How to?please show me. I tried with controllers and routes but unsuccessful also I don't wanna use Rules
– tasqynNov 9 '18 at 21:02

Why do you need controllers and routes? The most basic level only needs to use hook_form_alter. drupal.stackexchange.com/a/223452/57 you can look at the logged in user and inspect their roles, then do the redirect.
– KevinNov 9 '18 at 21:04

This is the correct way to redirect, in general. But in this case, to make pages inaccessible, the Drupal way would be to use permissions. Then you can redirect on the resulting 403 exception to show the frontpage instead.
– 4k4Nov 11 '18 at 23:12