We show that renormalization group (RG) theory applied to complex networks is useful to classify network topologies into universality classes in the space of configurations. The RG flow readily identifies a small-world-fractal transition by finding (i) a trivial stable fixed point of a complete graph, (ii) a nontrivial point of a pure fractal topology that is stable or unstable according to the amount of long-range links in the network, and (iii) another stable point of a fractal with shortcuts that exist exactly at the small-world-fractal transition. As a collateral, the RG technique explains the coexistence of the seemingly contradicting fractal and small-world phases and allows us to extract information on the distribution of shortcuts in real-world networks, a problem of importance for information flow in the system.