Switzerland centre-back Djourou joined Hamburg in a temporary switch with a reported view to a permanent move from Premier League side Arsenal in July.
The 27-year-old has made 22 appearances for Hamburg this season but has been unable to prevent them from enduring a nightmare campaign.
Slomka's arrival in February made him the third permanently appointed coach of the season after Thorsten Fink and his replacement Bert van Marwijk both paid the price for the side's poor form.
Hamburg are second bottom of the Bundesliga with six games to play, but the club appear to have been suitably impressed with the efforts of Djourou.
Slomka said: "I am happy that he's staying with us for the next few years as he's a stabilising influence at the centre of our defence."
No details of the deal have been released, although local media reports have indicated that Djourou has agreed a contract that will keep him with Hamburg until 2016.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.