Skip to content

Ambiguous URL behavior for /dir when /dir/index.html is absent is inconsistent with docs

The ambiguous URL behavior does not match documentation in the following scenario:

public/
  data.html
  data/
    page.html

In this case, a request for /data is being redirected to /data/.

The documentation states:

When public/data/index.html exists, it takes priority over the public/data.html file for both the /data and /data/ URL paths.

However, in this case, public/data/index.html does not exist. So the request ends up being redirected to a 404 page. The data.html page should be served instead.

Here's a sample project that demonstrates the problem: https://gitlab.com/mojavelinux/test-redirects

There's no way to request /blog since it is redirected to /blog/, which is a 404.

If the default cannot be changed, at least make it possible to add an entry to _redirects to resolve the ambiguity.

/blog /blog.html 200

Otherwise, certain websites just cannot be hosted on GitLab Pages.