{"record":{"id":"129a51db80164e5b","repo":"languagetool-org/languagetool","slug":"no-content-but-redirect-found-at-url","errorCode":null,"errorMessage":"No content but redirect found at '\" + url + \"'","messagePattern":"No content but redirect found at '\" \\+ url \\+ \"'","errorType":"exception","errorClass":"PageNotFoundException","httpStatus":null,"severity":"error","filePath":"languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java","lineNumber":142,"sourceCode":"  }\n\n  /**\n   * @since 2.6\n   */\n  public MarkupAwareWikipediaResult checkPage(URL url, ErrorMarker errorMarker) throws IOException, PageNotFoundException {\n    validateWikipediaUrl(url);\n    String xml = getMediaWikiContent(url);\n    if (xml.length() > maxSizeBytes) {\n      throw new RuntimeException(\"Sorry, the content at \" + url + \" is too big - this process has been limited to \" + maxSizeBytes +\n              \" bytes, but the content is \" + xml.length() + \" bytes\");\n    }\n    MediaWikiContent wikiContent = getRevisionContent(xml);\n    String content = wikiContent.getContent();\n    if (content.trim().isEmpty()) {\n      throw new PageNotFoundException(\"No content found at '\" + url + \"'\");\n    }\n    if (content.toLowerCase().contains(\"#redirect\")) {\n      throw new PageNotFoundException(\"No content but redirect found at '\" + url + \"'\");\n    }\n    return checkWikipediaMarkup(url, wikiContent, getLanguage(url), errorMarker);\n  }\n\n  MarkupAwareWikipediaResult checkWikipediaMarkup(URL url, MediaWikiContent wikiContent, Language language, ErrorMarker errorMarker) throws IOException {\n    SwebleWikipediaTextFilter filter = new SwebleWikipediaTextFilter();\n    PlainTextMapping mapping = filter.filter(wikiContent.getContent());\n    MultiThreadedJLanguageTool lt = getLanguageTool(language);\n    List<AppliedRuleMatch> appliedMatches = new ArrayList<>();\n    List<RuleMatch> matches;\n    try {\n      matches = lt.check(mapping.getPlainText());\n    } finally {\n      lt.shutdown();\n    }\n    int internalErrors = 0;\n    for (RuleMatch match : matches) {\n      SuggestionReplacer replacer = errorMarker != null ? ","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java#L124-L160","documentation":"Content guard in WikipediaQuickCheck.checkPage: the page has no direct content but the API returned a redirect, meaning the article lives under a different title; the caller should follow the redirect link given in the message.","triggerScenarios":"Thrown at languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the check against the redirect target URL","Resolve redirects server-side before calling checkPage"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}