We consider a two-layer fluid, having a general periodic bottom that is confined to the lower layer. In order to determine the free interfacial and surface wave modes of given frequency the lower layer is conformally mapped onto a uniform-depth layer. The map preserves the periodicity of medium (set by the bottom), hence determines the water depth in the transformed plane. The free wave modes are solved by use of Floquet theory, arriving at an infinite matrix determining the frequency-wavenumber relationship. The modes approach the classical interfacial and surface wave solutions in the case of a flat bottom, and an equivalent form of the latter for the interfacial wave mode in the case of a rigid lid. As for the classical, flat-bottom case, over a periodic bottom, the surface wave mode's vertical displacement of the interface is weaker than that of the surface, but is in-phase. By contrast, in the interfacial wave mode, the interfacial wave displacement is the largest and the surface wave displacement is in anti-phase. However, over the periodic bottom, on top of its response at the scale corresponding to the adopted frequency, the interface displacement shows a rapid modulation at bottom scale. This is true both for the interfacial, but most prominently for the surface wave mode.