In this paper we consider one-dimensional capillary redistribution of two immiscible and incompressible fluids in a porous medium with a single discontinuity. We study a special time-dependent solution, a similarity solution, which is found when the initial saturation is discontinuous at the same point as the permeability and porosity, and is constant elsewhere. The similarity solution can be used to validate numerical algorithms describing two-phase flow in porous media with discontinuous heterogeneities. We discuss the construction of the similarity solution, in which we pay special attention to the interface conditions at the discontinuity, both for media with positive and zero entry pressure. Moreover, we discuss some qualitative properties of the solution, and outline a numerical procedure to determine its graph. Examples are given for the Brooks-Corey and Van Genuchten model. We also consider similarity solutions for unsaturated water flow, which is a limit case of two-phase flow for negligible nonwetting phase viscosity.