View source: R/audit_canonicals.R
| audit_fold | R Documentation |
Audits how 3xx **redirects** and declared **rel=canonical** links combine into a single fold map, surfacing exactly where the two signals interact. Wraps [audit_redirects()] and [audit_canonicals()] for the per-signal views and adds the cross-signal tables from [build_fold_map()]: same-source disagreements, canonicals ignored because their source also redirects, and the 'canonical_conflict_policy' outcome.
Disagreements are never silently resolved – they are always reported here, regardless of which policy decides the winner.
audit_fold(
redirects_df = NULL,
canonicals_df = NULL,
edge_list_df = NULL,
redirect_from_col = "from",
redirect_to_col = "to",
canonical_from_col = "from",
canonical_to_col = "to",
duplicate_from_policy = c("strict", "first_wins", "last_wins", "most_frequent",
"prune_source", "resolve_if_consistent"),
loop_handling = c("error", "prune_loop", "break_arrow"),
canonical_duplicate_from_policy = c("strict", "first_wins", "last_wins",
"most_frequent", "prune_source", "resolve_if_consistent"),
canonical_loop_handling = c("error", "prune_loop", "break_arrow"),
canonical_conflict_policy = c("redirect_wins", "error", "canonical_wins"),
edge_from_col = "from",
edge_to_col = "to"
)
redirects_df |
Optional data frame of 3xx redirect rules, or 'NULL'. |
canonicals_df |
Optional data frame of declared rel=canonical links, or 'NULL'. Each row pairs a source URL with the canonical it declares. |
edge_list_df |
Optional edge list, passed to the per-signal audits for orphan detection. |
redirect_from_col, redirect_to_col |
From/to columns in 'redirects_df'. Default '"from"' / '"to"'. |
canonical_from_col, canonical_to_col |
From/to columns in 'canonicals_df'. Default '"from"' / '"to"'. |
duplicate_from_policy |
How to handle a redirect source with multiple distinct targets. See [resolve_redirects()]. Default '"strict"'. |
loop_handling |
How to handle redirect cycles. See [resolve_redirects()]. Default '"error"'. Also governs cross-signal cycles in the composed graph. |
canonical_duplicate_from_policy |
How to handle a canonical source with multiple distinct declared canonicals. Reuses the 'duplicate_from_policy' enum. Default '"strict"'. |
canonical_loop_handling |
How to handle cycles among declared canonicals. Reuses the 'loop_handling' enum. Default '"error"'. |
canonical_conflict_policy |
How to resolve a redirect-vs-canonical disagreement on the **same source** URL. One of:
|
edge_from_col, edge_to_col |
From/to columns in 'edge_list_df'. |
A list with class '"fold_audit"' containing:
The [audit_redirects()] result (or 'NULL').
The [audit_canonicals()] result (or 'NULL').
Data frame of same-source redirect-vs-canonical cases: 'source', 'redirect_to', 'canonical_to', 'disagrees', 'resolution'.
Data frame of canonicals dropped because their source also redirects (populated under '"redirect_wins"').
The 'canonical_conflict_policy' in effect.
[audit_redirects()], [audit_canonicals()], [build_fold_map()]
redirects <- data.frame(from = "http://a", to = "http://b")
canonicals <- data.frame(from = "http://a", to = "http://d")
# a redirects to b but also declares canonical d => disagreement
audit_fold(redirects, canonicals)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.