Many efficient light-emitting devices and photodetectors are based on semiconductors with, respectively, a direct or indirect bandgap configuration. The less known pseudodirect bandgap configuration can be found in wurtzite (WZ) semiconductors: here electron and hole wave-functions overlap strongly but optical transitions between these states are impaired by symmetry. Switching between bandgap configurations would enable novel photonic applications but large anisotropic strain is normally needed to induce such band structure transitions. Here we show that the luminescence of WZ GaAs nanowires can be switched on and off, by inducing a reversible direct-to-pseudodirect band structure transition, under the influence of a small uniaxial stress. For the first time, we clarify the band structure of WZ GaAs, providing a conclusive picture of the energy and symmetry of the electronic states. We envisage a new generation of devices that can simultaneously serve as efficient light emitters and photodetectors by leveraging the strain degree of freedom.