Would you please tell me what will be code to add to .htaccess file
Nope, sorry, not on this forum.
Hey, wait. You've been around since 2006. You already know that.
If you need cut-and-paste, you could try That Other Forum. They seem to be right more than 50% of the time. If, on the other hand, you're interested in learning how to roll your own,* let's see what you've got so far and we'll take it from there.
That was a weird link. If you leave the 404 page open, it eventually drifts over to the front page. But that is rarely what you want to do in real life.
* I really should not use this expression. I could not roll my own to save my life. Fortunately there was no shortage of head shops in the town where I first went to college.