Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `scp_alias_hosts` fuzzy rule canonicalising the SCP wiki's alias hosts (`scpwiki.com`, `www.scpwiki.com`, `www.scp-wiki.net`) onto `scp-wiki.wikidot.com` ; all of them serve the same wiki with HTTP 200 rather than a redirect, so without it the same article lands at several ZIM paths and cross-host links resolve to nothing (#423, openzim/zim-requests#402)

## [5.6.0] - 2026-11-20

### Added
Expand Down
43 changes: 43 additions & 0 deletions rules/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,49 @@
# `unreplace_pattern`, so `defuzzify()` correctly leaves its output unchanged instead of
# guessing.
fuzzyRules:
# --- SCP wiki (openzim/zim-requests#402) -------------------------------------
# The English SCP wiki is served, identically and with HTTP 200 rather than a
# redirect, on several hostnames: scp-wiki.wikidot.com (canonical), scpwiki.com,
# www.scpwiki.com and www.scp-wiki.net. Pages link across them freely -- SCP-4558's
# own ListPages pager points at http://www.scp-wiki.net/scp-4558/offset/1 -- so
# without canonicalisation the same article lands at several ZIM paths and
# cross-host links resolve to nothing. Measured on a 10-page crawl: 30 broken
# links and SCP-4558's whole offset chain stored twice under alias hosts.
#
# Anchored with ^, unlike most rules here, because this rewrites the *host*. That is
# not hypothetical: sibling language branches live on subdomains of these very
# domains -- ko.scp-wiki.net, linked from other branches' pages -- and an unanchored
# match would rewrite them onto the English wiki, as well as any lookalike host.
#
# unreplace_pattern is the never-matching (?!): the forward rule cannot know which
# alias a canonical URL came from, and the overwhelming majority of
# scp-wiki.wikidot.com URLs were never aliased at all, so mapping them back to an
# alias would be wrong far more often than right. Leaving the canonical URL in
# place is both plausible and correct for the common case.
- name: scp_alias_hosts
pattern: ^(?:www\.)?(?:scpwiki\.com|scp-wiki\.net)/(.*)
replace: scp-wiki.wikidot.com/\1
unreplace_pattern: (?!)
unreplace: ""
tests:
- raw_url: scpwiki.com/scp-173
fuzzified_url: scp-wiki.wikidot.com/scp-173
defuzzified_url: scp-wiki.wikidot.com/scp-173
- raw_url: www.scpwiki.com/scp-173
fuzzified_url: scp-wiki.wikidot.com/scp-173
defuzzified_url: scp-wiki.wikidot.com/scp-173
- raw_url: www.scp-wiki.net/scp-4558/offset/1
fuzzified_url: scp-wiki.wikidot.com/scp-4558/offset/1
defuzzified_url: scp-wiki.wikidot.com/scp-4558/offset/1
- raw_url: scp-wiki.wikidot.com/scp-173
unchanged: true # already canonical
- raw_url: evil-scpwiki.com/scp-173
unchanged: true # anchored, so a lookalike host is not rewritten
- raw_url: ko.scp-wiki.net/scp-173
unchanged: true # a sibling language branch lives on a subdomain of an alias
- raw_url: scp-wiki.wdfiles.com/local--files/scp-173/x.png
unchanged: true # the file store is a different host and stays as it is

- name: googlevideo_com
pattern: .*googlevideo.com/(videoplayback(?=\?)).*[?&](id=[^&]+).*
replace: youtube.fuzzy.replayweb.page/\1?\2
Expand Down