[reaction: see text] The first intrazeolite-photoinduced rearrangement of a five-membered heterocycle is reported. A completely different behavior compared to solution irradiations has been observed. The zeolite's role in directing the photoreaction of 3-phenyl-1,2,4-oxadiazoles toward the formation of the corresponding 1,3,4-oxadiazoles in a ring contraction-ringexpansion route is discussed.