The Borrmann effect, which is related to the microscopic distribution of the electromagnetic field inside the primitive cell, is studied in photonic and magnetophotonic crystals. This effect, well-known in x-ray spectroscopy, is responsible for the enhancement or suppression of various linear and nonlinear optical effects when the incidence angle and/or the frequency change. It is shown that by design of the primitive cell this effect can be suppressed and even inverted.