Direct laser writing is widely used for fabrication of subsurface, three dimensional structures in transparent media. However, the accessible volume is limited by distortion of the focussed beam at the sample edge. We determine the aberrated focal intensity distribution for light focused close to the edge of the substrate. Aberrations are modelled by dividing the pupil into two regions, each corresponding to light passing through the top and side facets. Aberration correction is demonstrated experimentally using a liquid crystal spatial light modulator for femtosecond microfabrication in fused silica. This technique allows controlled sub-surface fabrication right up to the edge of the substrate. This can benefit a wide range of applications using direct laser writing, including the manufacture of waveguides and photonic crystals. © 2012 Optical Society of America.