Menu

1 / 2

HTML base and SEO: Audit the URL Behind Every Relative Link

DEV Community: html·Uriel Bitton·6 days ago
#QONr5PRS
#devto2#devto#dev#export#base
Reading 0:00
15s threshold

For an HTML base href SEO problem, compare the link as written, the document's effective base address and the destination the browser resolves. A relative link can look reasonable in a template while pointing to the wrong page in the rendered document. Changing the anchor text will not repair that address.

Start with a real destination mismatch. Then inspect the mechanism that produced it. The method below uses fictional Alder Docs and reserved example addresses to make the checks concrete. It is a worked example, not a report of testing a live customer site.

Identify which address you are inspecting

A page can have several addresses worth recording: the URL requested, the URL reached after navigation, the base used for relative references and the final destination of a clicked link. Give each field its own name. “The URL” is too ambiguous for a useful bug report.

MDN's base-element reference explains that the base element supplies the base URL for relative URLs in a document.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.