1. Dipteran communities were studied in five terrestrial habitats [beech forest (BE), oak and hornbeam forest (OH), hedgerow (HE), meadow (ME), alder and willow forest (AW)] using emergence traps and diversity patterns of three trophic groups with soil-dwelling larvae (zoophages, phytosaprophages and surface scrapers) were analysed in detail.
2. Across habitats, sampling effort was a poor predictor of species richness, and species richness increased more steeply with sample size in the zoophages than in the phytosaprophages and surface scrapers.
3. Point diversity (S/trap) of phytosaprophages and surface scrapers increased (as predicted) with resource heterogeneity in the litter layer, but that of zoophages did not. It is suggested that this may be due to differential resource requirements of the three trophic groups during adult life.
4. Zoophages attained the highest and surface scrapers the lowest values of Shannon diversity, while phytosaprophages were intermediate.
5. Predator:prey ratios differed between habitats; they were particularly high in the meadow and low in the oak and hornbeam forest communities.
6. Species identity (Sorensen index) of soil-dwelling Diptera arranged habitats in an order of decreasing similarity (BE–OH–HE–ME–AW), but percentage similarity indicated a closer relationship between the meadow and the hedgerow communities [BE–OH–AW–(HE–ME)]. Functional similarity, which was based on the proportional biomass of differently sized trophic groups, was highest between the BE and OH communities, i.e. in the habitats most similar in litter layer and vegetation structure.