It will be hard to meet this requirement, because to handle it server side, you will have to make a guess and force a redirect to home page when you are asked for detail page and when you are already there.
And I really say guess, because I cannot imagine how you could differentiate that from a full refresh (Ctrl-F5 on common browsers) ...
The alternative would be to use Javascript to try to intercept the usage of back button. But unfortunately you will have mainly the onbeforeunload
event, and still no way I know to differentiate a back from a refresh.
But anyway, you do not want to do that. Your user clicked somewhere on first detail page and should know that something happened before he went back there (you could even have a message for that in the way of the flash from rails or Spring MVC). So he expects that the back button which brings him back one step will need 2 click to bring him back to home page.
The rule on UI is : even if you think that a different way would be nicer, always stick to common usage if you want your users to have a good experience with your application.