Stacking of van der Waals (vdW) heterostructures and chemical element doping have emerged as crucial methods for enhancing the performance of semiconductors. This study proposes a novel strategy for modifying heterostructures by codoping MoS2 with two elements, Re and W, resulting in the construction of a RexWyMo1-x-yS2/WSe2 heterostructure for the preparation of photodetectors. This approach incorporates multiple strategies to enhance the performance, including hybrid stacking of materials, type-II band alignment, and regulation of element doping. As a result, the RexWyMo1-x-yS2/WSe2 devices demonstrate exceptional performance, including high photoresponsivity (1550.22 A/W), high detectivity (8.17 × 1013 Jones), and fast response speed (rise/fall time, 190 ms/1.42 s). Moreover, the ability to tune the band gap through element doping enables spectral response in the ultraviolet (UV), visible light, and near-infrared (NIR) regions. This heterostructure fabrication scheme highlights the high sensitivity and potential applications of vdW heterostructure (vdWH) in optoelectronic devices.