We present the experimental test of a method for controlling the absolute length of the diagonals of square ring laser gyroscopes. The purpose is to actively stabilize the ring cavity geometry and to enhance the rotation sensor stability in order to reach the requirements for the detection of the relativistic Lense-Thirring effect with a ground-based array of optical gyroscopes. The test apparatus consists of two optical cavities 1.32 m in length, reproducing the features of the ring cavity diagonal resonators of large frame He-Ne ring laser gyroscopes. The proposed measurement technique is based on the use of a single diode laser, injection locked to a frequency stabilized He-Ne/Iodine frequency standard, and a single electro-optic modulator. The laser is modulated with a combination of three frequencies allowing to lock the two cavities to the same resonance frequency and, at the same time, to determine the cavity Free Spectral Range (FSR). We obtain a stable lock of the two cavities to the same optical frequency reference, providing a length stabilization at the level of 1 part in $10^{11}$, and the determination of the two FSRs with a relative precision of 0.2 ppm. This is equivalent to an error of 500 nm on the absolute length difference between the two cavities.