In this paper, the problem of optimizing the output regulation of a weakly dual redundant plant is addressed. When the system is underactuated, only a subset of the outputs can be arbitrarily controlled and the remaining ones are constrained. With a specific focus on the asymptotic output tracking problem for single-input systems, we investigate the connection between the overall optimal input and the individually optimal controllers, which leads to the perfect tracking of each output reference. Such relationship is analyzed both for open-loop and closed-loop controllers for different cost functions and types of references, and the optimality principles are established, provided that suitable structural conditions are met by the plant matri...