Sub topic 2
What a Backlink Is and How It Differs from an Internal Link
This chapter assumes you can read simple HTML, know what a URL is, and understand that search engines crawl pages and store them in an index. It covers one idea: what makes a link a backlink, and how a backlink differs from an internal link.
The definition depends on the target
A backlink is a hyperlink on one page that points to a page on a different website. The term describes the link from the target's side. The page that holds the link sees an outgoing link. The page that receives it sees a backlink.
Take this link on blog.example.org:
<a href="https://example.com/guide" rel="nofollow">Example guide</a>For blog.example.org, this is an outgoing (external) link. For https://example.com/guide, the same line of HTML is a backlink. The markup is identical in both cases. Only the point of view changes.
Other terms for the same thing are inbound link and incoming link. SEO tools often call the site that holds the link the "referring domain" or "linking domain."
Backlink or internal link
The test is whether the source and the target belong to the same site. An internal link connects two pages on the same site. A backlink connects two different sites.
| Property | Internal link | Backlink |
|---|---|---|
| Source and target | Same site | Different sites |
| Who controls the link | You, the site owner | Someone else |
| Main purpose | Navigation and discovery of your own pages | Reference to your page from outside |
| Example | `example.com/blog` links to `example.com/pricing` | `news.example.net` links to `example.com/pricing` |
| Typical SEO use | Spread attention across your site, help crawlers reach pages | Signal that others consider your page worth citing |
Because you control internal links, search engines treat them as a statement about your own site's structure. A backlink comes from an independent party, so it carries information you could not produce yourself. This is why backlinks get so much attention, and the later chapters on PageRank and link quality build on this difference.
Edge cases for "same site"
The boundary is not always the domain name. Some cases to watch:
- Subdomains.
blog.example.comandshop.example.comcan be run as separate sites or as one. Search tools often count a link between them as external, but the owner may see it as internal. Check how your tool treats them. - Several domains owned by one person. A link from
example-a.comtoexample-b.comis technically a backlink. Search engines can still notice common ownership, and heavy cross-linking between your own domains may look like manipulation. A later chapter covers that risk. - Redirected pages. A link to an old URL that redirects to a new one still points at your content, but the link goes to the old address first.
Reading links in HTML
You can classify any link by comparing the page you are on with the href value.
from urllib.parse import urlparse
def classify_link(page_url, href):
"""Label a link as internal or external relative to the page that holds it."""
page_host = urlparse(page_url).hostname
target = urlparse(href)
# Relative links such as "/pricing" have no hostname, so they stay on the same site.
if target.hostname is None or target.hostname == page_host:
return "internal"
return "external"
page = "https://example.com/blog/post"
for href in ["/pricing", "https://example.com/about", "https://example.org/guide"]:
print(href, "->", classify_link(page, href))Running this prints internal for the first two links and external for the third. The external link on example.com is a backlink for whatever page example.org/guide is. This simple version compares full hostnames, so it would label a link from example.com to www.example.com as external. Real tools use a list of public suffixes to compare registrable domains, but the principle is the same.
How the two link types relate
A backlink does not work alone. When another site links to your page, a crawler can reach your site from there. After that, your internal links carry crawlers and attention to your other pages. A strong backlink to one page can therefore help the whole site when that page links onward.
Common mistakes
- Counting internal links as backlinks. A link from one of your pages to another of your pages never counts.
- Assuming every backlink helps. A backlink is only a link from another site. Its value depends on the qualities covered in later chapters.
- Forgetting direction. If you link to a site, you give it a backlink. If it links to you, you receive one.
Exercise
The page https://shop.example.com/cart contains the links <a href="/help">, <a href="https://example.com/">, and <a href="https://partner.example.net/offer">. Which of these is a backlink, and for which page? Assume shop.example.com and example.com are treated as separate sites by your tool.
Show answer
The link to https://partner.example.net/offer is a backlink for that page, because it points to a different site. The link to /help is an internal link. The link to https://example.com/ is a backlink to that page if the tool treats the two subdomains as separate sites, so the answer depends on how the tool defines a site.
Exercise
Why does a search engine learn more about your page from a backlink than from an internal link?
Show answer
You control your internal links, so they only describe your own site. A backlink comes from an independent site owner, so it shows that someone else chose to reference your page.