Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Addresses that do not exist answer 200 with the home page: /robots.txt, /favicon.ico and any path without a language

オープン
#604 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@guidol-ive がすでに取り組んでいます。

2026年10月28日 から。

  • #608 @guidol-ive による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
php
領域
backend

調査の方向性

Read system/core/HyphaRequest.php around lines 82 and 104-107, then system/core/pages.php around lines 250-254 and system/datatypes/index.php around lines 33-38. Start with tests/HyphaRequestTest.php and check the linked pull request #608 for the current proposed behavior. Done means the listed invalid paths and unused language index return 404, while root, index.php, and the <type>/<name> form keep their intended behavior.

索引モデルが issue の本文から書いたものです。

説明

Impact: Medium Level: Easy Type: Bug Usecase: De Stadsbron Value: Visitors

Every address whose first segment is neither a language nor a system page answers 200 with the home page. Search engines, link checkers and monitoring therefore never see a 404 for a mistyped or removed address, and every such URL is indexed as one more copy of the home page (a "soft 404", duplicate content).

Request Answer on main
/robots.txt 200, text/html, the home page (crawlers read it as robots.txt; see also #523)
/favicon.ico 200, text/html, the home page
/wp-login.php, /anything, /Over_ons 200, the home page
/foo/Over_ons 200, the page nl/Over_ons (a second URL for every page)
/index/fr (no French page exists) 200, an empty page index
/xx/yy/zz, /nl/Geen_pagina 404 (correct)

Cause. HyphaRequest::processRequest() (system/core/HyphaRequest.php:104-107) drops the first segment of a path without a language as a "page type" (the form <type>/<name> of tests/HyphaRequestTest.php, such as festival/festival). For /robots.txt the page name is then empty, and loadPage() (system/core/pages.php:250-254) shows the default page. The page index (system/datatypes/index.php:33-38) accepts every code of languages.json, also one that no page uses.

A related slip: HyphaRequest keeps a query that directly follows the root (/?utm_source=x) as a path segment, because strpos() returns 0 there and 0 && ... is false (HyphaRequest.php:82). Today that only works by accident (the segment is dropped as a "page type").

Evidence (PHP 8.2 container of docs/container, fictional test site with pages in nl and en):

$ curl -s -o /dev/null -w '%{http_code} %{content_type}\n' http://127.0.0.1:8172/robots.txt
200 text/html; charset=utf-8
$ curl -s http://127.0.0.1:8172/favicon.ico | grep -o '<div id="main">.\{0,40\}'
<div id="main"><p>Welkom op de proefsite van Eemstad.
$ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8172/index/fr
200

Suggested fix. Only the root (and index.php, which hypha.php mentions as the entry) without a language shows the default page; another path without a language and page name gives 404. The page index of a language that no page uses gives 404, like the index of an unknown code already does. Strip a query at position 0 as well. The <type>/<name> form keeps working; whether it should rather redirect (301) to <language>/<name> is a question for the maintainers, as is a redirect of the root to /<default language>/<home page> (canonical URLs are #521).

Found while checking multilingual sites for SEO. Tested in the PHP 8.2 and 8.5 containers of docs/container with a fictional test site: reproduces on main (d97ab7b), gone with the linked pull request, which is offered as a suggestion and a starting point.

🤖 Generated with Claude Code

主要言語
JavaScript
スター
5
フォーク
9
平均マージ
19時間 10分
マージ済み PR(30日)
12

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PlanBCode/hypha のほかの issue

PlanBCode/hypha の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。