There are two ways to understand the phrase to this day.
It could suggest that the book of Joshua was completed sometime after the events it describes but before the death of Rahab. Alternatively, it could refer to Rahab’s descendants and the fact that they are still living among the Israelites.
25 But Rahab the prostitute and her father’s household and all who belonged to her, Joshua saved alive. And she has lived in Israel to this day, because she hid the messengers whom Joshua sent to spy out Jericho.