We invoke a metric to quantify the correlation between any two earthquakes. This provides a simple and straightforward alternative to using space-time windows to detect aftershock sequences and obviates the need to distinguish main shocks from aftershocks. Directed networks of earthquakes are constructed by placing a link, directed from the past to the future, between pairs of events that are strongly correlated. Each link has a weight giving the relative strength of correlation such that the sum over the incoming links to any node equals unity for aftershocks, or zero if the event had no correlated predecessors. Events can be aftershocks of many previous events, and also generate many aftershocks. The probability distribution for the number of incoming and outgoing links are both scale free, and the networks are highly clustered and modular. The Omori law holds for aftershock rates with a decorrelation time that grows with the magnitude of the initiating shock. Another scaling law is found for the fat-tailed distribution of distances between earthquakes and their aftershocks, which extends over the range covered by the catalogue, or hundreds of kilometers, even for intermediate magnitude events. This result is inconsistent with the hypothesis of aftershock zone scaling, but consistent with observations of remote triggering. We also find evidence that seismicity is dominantly triggered by small earthquakes. This approach, using concepts from the modern theory of complex networks, together with a metric to estimate correlations, opens up new avenues of research, as well as new tools to understand seismicity.