HTML and web guides

Check repeat links before moving an HTML page

·

Before moving an HTML page, check which relative references depend on its location. A base element can make two differently written attributes point to the same URL. Compare both the original attribute and resolved address before editing.

Link Extractor

Choose Load journal example and Extract links. The supplied page address ends in /archive/index.html. The base element uses /journal/, so the Relative URL base ends in /journal/.

The grouped report shows 9 source references and 8 grouped destinations. Filter Link type to Internal. The map row resolves to https://studio.example.test/journal/map?view=print&lang=en and has 2 occurrences. The first source location is a[href] at 7:6.

WHATWG HTML Standard — Document base URLsWHATWG URL Standard — URL parsing

See both attribute spellings

Turn on Show repeated references. The Internal filter now shows a path beginning with map and a path beginning with /journal/map. Both have the same resolved address. Their positions are 7:6 and 8:6. The source attribute column shows the parsed ampersand in the query.

Try the Image filter. The image’s ../images/stamp.png becomes https://studio.example.test/images/stamp.png. The category describes its role in the markup. The extractor handles the stylesheet and script references as a separate Resource category.

WHATWG HTML Standard — LinksWHATWG URL Standard — URL parsing

Check the filtered CSV before editing

Return to Internal and turn off Show repeated references. Download CSV and open it with UTF-8 encoding and a comma delimiter. The single map row contains the original attribute, resolved address, element, line, column and occurrence count. With repeats enabled, the export reports one row per original occurrence.

If your own report shows Unresolved relative, supply the page address from which the markup came and rerun it. Source positions and URLs support a markup review. The report contains no response codes from the destinations.

Common questions

Can the report show a link added by a script?

The report reads parsed source markup. To inspect links inserted by a running script, provide HTML that already contains them.

Why does a fragment resolve under the base path?

A fragment-only href also uses the effective base URL for resolution. The Fragment category identifies its source spelling.

Sources

Put it into practice.

Related guides