I once had a .html file that redirected the user to his/her last visited page. (or current)

Letīs say Iīm in www.ThisIsTheSiteImCurrentlyViewing.com and type www.myowndomain.com in the adress-bar then I came back to www.ThisIsTheSiteImCurrentlyViewing.com like I never typed the other url.

I donīt remember what that html code was but I really want it now.

Can sombody help me with this?

Best Regards