Whenever any real property has been sold for taxes and has been redeemed, the money paid for redemption shall be apportioned and paid to the district by the county treasurer in the proportion which the tax due to the district bears to the total tax for which the property was sold.