Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-02-01 22:32:08 +0300
committerNick Thomas <nick@gitlab.com>2019-02-04 16:06:08 +0300
commit618774154be6d6b67499498e1bdb33a8bf94f16d (patch)
treecd929fd10f3d83b1dd0bda85f2cb3a94b57c9ad3
parent3a042391ae89b967ce104acf3dbe8191c572ef25 (diff)
Add support for extensionless pages URLs
-rw-r--r--GITLAB_PAGES_VERSION2
-rw-r--r--changelogs/unreleased/update-pages-extensionless-urls.yml5
-rw-r--r--doc/user/project/pages/introduction.md51
3 files changed, 57 insertions, 1 deletions
diff --git a/GITLAB_PAGES_VERSION b/GITLAB_PAGES_VERSION
index 88c5fb891dc..bc80560fad6 100644
--- a/GITLAB_PAGES_VERSION
+++ b/GITLAB_PAGES_VERSION
@@ -1 +1 @@
-1.4.0
+1.5.0
diff --git a/changelogs/unreleased/update-pages-extensionless-urls.yml b/changelogs/unreleased/update-pages-extensionless-urls.yml
new file mode 100644
index 00000000000..13b3e1df500
--- /dev/null
+++ b/changelogs/unreleased/update-pages-extensionless-urls.yml
@@ -0,0 +1,5 @@
+---
+title: Add support for extensionless pages URLs
+merge_request: 24876
+author:
+type: added
diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md
index 2bb6fcd9d74..cebff38ba88 100644
--- a/doc/user/project/pages/introduction.md
+++ b/doc/user/project/pages/introduction.md
@@ -356,6 +356,57 @@ By pre-compressing the files and including both versions in the artifact, Pages
can serve requests for both compressed and uncompressed content without
needing to compress files on-demand.
+### Resolving ambiguous URLs
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/issues/95) in GitLab 11.8
+
+GitLab Pages makes assumptions about which files to serve when receiving a
+request for a URL that does not include an extension.
+
+Consider a Pages site deployed with the following files:
+
+```
+public/
+├─┬ index.html
+│ ├ data.html
+│ └ info.html
+│
+├── data/
+│ └── index.html
+├── info/
+│ └── details.html
+└── other/
+ └── index.html
+```
+
+Pages supports reaching each of these files through several different URLs. In
+particular, it will always look for an `index.html` file if the URL only
+specifies the directory. If the URL references a file that doesn't exist, but
+adding `.html` to the URL leads to a file that *does* exist, it will be served
+instead. Here are some examples of what will happen given the above Pages site:
+
+| URL path | HTTP response | File served |
+| -------------------- | ------------- | ----------- |
+| `/` | `200 OK` | `public/index.html` |
+| `/index.html` | `200 OK` | `public/index.html` |
+| `/index` | `200 OK` | `public/index.html` |
+| `/data` | `200 OK` | `public/data/index.html` |
+| `/data/` | `200 OK` | `public/data/index.html` |
+| `/data.html` | `200 OK` | `public/data.html` |
+| `/info` | `200 OK` | `public/info.html` |
+| `/info/` | `200 OK` | `public/info.html` |
+| `/info.html` | `200 OK` | `public/info.html` |
+| `/info/details` | `200 OK` | `public/info/details.html` |
+| `/info/details.html` | `200 OK` | `public/info/details.html` |
+| `/other` | `302 Found` | `public/other/index.html` |
+| `/other/` | `200 OK` | `public/other/index.html` |
+| `/other/index` | `200 OK` | `public/other/index.html` |
+| `/other/index.html` | `200 OK` | `public/other/index.html` |
+
+NOTE: **Note:**
+When `public/data/index.html` exists, it takes priority over the `public/data.html`
+file for both the `/data` and `/data/` URL paths.
+
### Add a custom domain to your Pages website
For a complete guide on Pages domains, read through the article