Hi Harshal,
if you want to manipulate the browser history, you can check out this excellent documentation on Mozilla Developer Network: Manipulating the browser history
Maybe you can work with the window.onpopstate event to detect the unwanted entries an manipulate them. It's important to know, that you can not delete entries from the browser history (you can just add new entries and modify the current one).
Besides, it's better to use the above-mentioned HTML5 API and not the older window.location.replace functionality.
Regards Michael