Three series of semiflexible and rigid main-chain polyesters containing photoreactive mesogenic units derived from p-phenylenediacrylic acid (PDA) and cinnamic acid have been synthesized by high-temperature polycondensation. The thermal and mesomorphic properties of the polymers have been determined. The photochemical behavior of polymer P-[1]-T, which contains a PDA unit, has been studied both in solution and in films. In solution, [2þ2] photocycloaddition, E/Z photoisomerization, and photo-Fries rearrangement can take place. In contrast, the dominant process in spin-coated films is the [2þ2] photocycloaddition reaction, which causes crosslinking of the polymer. In films, the photochemistry and induction of anisotropy are strongly influenced by the aggregation of the PDA phenylester unit. A dichroism of about 0.2 has been induced in films by irradiation with linearly polarized UV light, and thus the capability of these films to induce optical anisotropy and align liquid crystals has been demonstrated. Liquid-crystalline cells have been made with polarized irradiated films of P-[1]-T as aligning layers. A commercial liquidcrystalline mixture has been used for this study, and a similar liquid-crystalline order determined by polarized Fourier transform infrared to a commercial cell with rubbed polyimide as an aligning layer has been detected. Because of crosslinking of the irradiated P-[1]-T photoaligning layer, the photoinduced anisotropy is stable at high temperatures, and the liquid-crystalline molecules are insoluble in the irradiated polymer. V V C 2005 Wiley Periodicals, Inc. J Polym Sci Part A: Polym Chem 43: 4907-4921, 2005