From 87a29b00835c0f855bda6e4f06205e7ca30ac778 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 10 Sep 2020 10:09:27 -0500 Subject: [PATCH 01/12] Add docs for Gitlab Pages Redirects Redirects feature added in https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/336 --- doc/user/project/pages/index.md | 1 + doc/user/project/pages/introduction.md | 9 +-- doc/user/project/pages/redirects.md | 96 ++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 doc/user/project/pages/redirects.md diff --git a/doc/user/project/pages/index.md b/doc/user/project/pages/index.md index eff80a4c9bd6c7..57483882a16e8a 100644 --- a/doc/user/project/pages/index.md +++ b/doc/user/project/pages/index.md @@ -59,6 +59,7 @@ To update a GitLab Pages website: | [Explore GitLab Pages](introduction.md) | Requirements, technical aspects, specific GitLab CI/CD configuration options, Access Control, custom 404 pages, limitations, FAQ. | | [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. | | [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. | +| [Redirects](redirects.md) | Set up redirects to forward one page to another | Learn more and see examples: diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md index b497e6ae563135..e9c73a9b5f1040 100644 --- a/doc/user/project/pages/introduction.md +++ b/doc/user/project/pages/introduction.md @@ -60,14 +60,7 @@ If the case of `404.html`, there are different scenarios. For example: ## Redirects in GitLab Pages -Since you cannot use any custom server configuration files, like `.htaccess` or -any `.conf` file, if you want to redirect a page to another -location, you can use the [HTTP meta refresh tag](https://en.wikipedia.org/wiki/Meta_refresh). - -Some static site generators provide plugins for that functionality so that you -don't have to create and edit HTML files manually. For example, Jekyll has the -[redirect-from plugin](https://github.com/jekyll/jekyll-redirect-from), Sphinx -has the [sphinx-reredirects](https://gitlab.com/documatt/sphinx-reredirects) extension. +You can configure redirects for your site using a `_redirects` file. To learn more visit the [redirects documentation](redirects.md). ## GitLab Pages Access Control **(CORE)** diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md new file mode 100644 index 00000000000000..de9f6f56e496ed --- /dev/null +++ b/doc/user/project/pages/redirects.md @@ -0,0 +1,96 @@ +--- +type: reference +last_updated: 2020-09-09 +stage: Release +group: Release Management +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + +# Set up Redirects for GitLab Pages + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/24) in GitLab Pages v1.25.0(behind the `FF_ENABLE_REDIRECTS` feature flag) and GitLab 13.4. + +Setting up GitLab Pages with redirects is an optional feature of GitLab Pages. +This will allow you to configure rules to forward one URL to another. + +GitLab Pages uses [Netlify style redirects](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file) and only supports the [`_redirects` plain text file syntax](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file). + +WARNING: **Warning:** +`.toml` files are not supported. + +Currently, redirects are only supported at a basic level and GitLab Pages does not support all of the [special options offered by Netlify](https://docs.netlify.com/routing/redirects/redirect-options/). Here is a breakdown of what is and what is not supported: + +| Feature | Supported | Example | +| ------- | --------- | ------- | +| Redirects (`301`, `302`) | :white_check_mark: | `/wardrobe.html /narnia.html 302` +| Rewrites (other status codes) | :x: | `/en/* /en/404.html 404` | +| Splats | :x: | `/news/* /blog/:splat` | +| Placeholders | :x: | `/news/:year/:month/:date/:slug /blog/:year/:month/:date/:slug` | +| Query parameters | :x: | `/store id=:id /blog/:id 301` | +| Force ([shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)) | :x: | `/app/ /app/index.html 200!` | +| Domain-level redirects | :x: | `http://blog.yoursite.com/* https://www.yoursite.com/blog/:splat 301` | +| Redirect by country or language | :x: | `/ /anz 302 Country=au,nz` | +| Redirect by role | :x: | `/admin/* 200! Role=admin` | + +NOTE: **Note:** +Supported paths must start with a forward slash `/`. + +## Adding redirect configuration + +Add a configuration file named `_redirects` under the `public/` directory of your Pages site. + +If you access your GitLab Pages site using the default domain name, for example `namespace.gitlab.io/projectname`, +you will need to prefix every rule with the project name. For example, + +```plaintext +/projectname/redirect-portal.html /projectname/magic-land.html 301 +/projectname/cake-portal.html /projectname/still-alive.html 302 +/projectname/wardrobe.html /projectname/narnia.html 302 +/projectname/pit.html /projectname/spikes.html 302 +``` + +--- + +You do not need to prefix the project name if you use [custom domains](custom_domains_ssl_tls_certification/index.md). For example, if your custom domain is `example.com`, your `_redirect` file would look like: + +```plaintext +/redirect-portal.html /magic-land.html 301 +/cake-portal.html /still-alive.html 302 +/wardrobe.html /narnia.html 302 +/pit.html /spikes.html 302 +``` + +## Shadowing (overriding a file) + +Files take priority over a redirect. +If a file exists on disk, then we serve that file instead of your redirect. + +For example, if you have the files `hello.html` and `world.html` and the following `_redirects` file. The `hello.html` file will be served because the file exists and the redirect rule will be ignored. + +```plaintext +/projectname/hello.html /projectname/world.html 302 +``` + +Netlify has a [force option](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing) +to change this behavior but this is not supported yet. + +## Debugging redirect rules + +If one of your redirects isn't working or you want to check to make sure your syntax is correct, +you can browse to the redirects config itself `https://namespace.gitlab.io/projectname/_redirects`. +The `_redirects` file will not be served directly, instead, it will show a numbered list of your redirect rules and indicate whether the rule is valid or if GitLab Pages encountered an error parsing that line. + +```plaintext +11 rules +rule 1: valid +rule 2: valid +rule 3: error: splats are not supported +rule 4: valid +rule 5: error: placeholders are not supported +rule 6: valid +rule 7: error: no domain-level redirects to outside sites +rule 8: error: url path must start with forward slash / +rule 9: error: no domain-level redirects to outside sites +rule 10: valid +rule 11: valid +``` -- GitLab From 6ac67e33591e75cceb660551a32cf026108748de Mon Sep 17 00:00:00 2001 From: Amy Qualls Date: Tue, 15 Sep 2020 13:39:32 -0700 Subject: [PATCH 02/12] Technical writer revision of the page Revise the page to get it closer to GitLab tone and style standards. --- doc/user/project/pages/redirects.md | 103 ++++++++++++++++++---------- 1 file changed, 68 insertions(+), 35 deletions(-) diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index de9f6f56e496ed..82761e50124f27 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -6,41 +6,52 @@ group: Release Management info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers --- -# Set up Redirects for GitLab Pages +# Create redirects for GitLab Pages -> [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/24) in GitLab Pages v1.25.0(behind the `FF_ENABLE_REDIRECTS` feature flag) and GitLab 13.4. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/24) in GitLab Pages 1.25.0 and GitLab 13.4. +> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default. +> - It's disabled on GitLab.com. +> - It's not recommended for production use. +> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-redirects). -Setting up GitLab Pages with redirects is an optional feature of GitLab Pages. -This will allow you to configure rules to forward one URL to another. +CAUTION: **Warning:** +This feature might not be available to you. Check the **version history** note above for details. -GitLab Pages uses [Netlify style redirects](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file) and only supports the [`_redirects` plain text file syntax](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file). +In GitLab Pages, you can [enable](#enable-or-disable-redirects) the redirects feature to configure rules for forwarding one URL to another using HTTP redirects. GitLab Pages uses +[Netlify style redirects](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file). -WARNING: **Warning:** -`.toml` files are not supported. +## Supported features -Currently, redirects are only supported at a basic level and GitLab Pages does not support all of the [special options offered by Netlify](https://docs.netlify.com/routing/redirects/redirect-options/). Here is a breakdown of what is and what is not supported: +GitLab Pages only supports the +[`_redirects` plain text file syntax](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file), +and `.toml` files are not supported. + +Redirects are only supported at a basic level, and GitLab Pages doesn't support all +[special options offered by Netlify](https://docs.netlify.com/routing/redirects/redirect-options/): | Feature | Supported | Example | | ------- | --------- | ------- | -| Redirects (`301`, `302`) | :white_check_mark: | `/wardrobe.html /narnia.html 302` -| Rewrites (other status codes) | :x: | `/en/* /en/404.html 404` | -| Splats | :x: | `/news/* /blog/:splat` | -| Placeholders | :x: | `/news/:year/:month/:date/:slug /blog/:year/:month/:date/:slug` | -| Query parameters | :x: | `/store id=:id /blog/:id 301` | -| Force ([shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)) | :x: | `/app/ /app/index.html 200!` | -| Domain-level redirects | :x: | `http://blog.yoursite.com/* https://www.yoursite.com/blog/:splat 301` | -| Redirect by country or language | :x: | `/ /anz 302 Country=au,nz` | -| Redirect by role | :x: | `/admin/* 200! Role=admin` | +| Redirects (`301`, `302`) | **{check-circle}** Yes | `/wardrobe.html /narnia.html 302` +| Rewrites (other status codes) | **{dotted-circle}** No | `/en/* /en/404.html 404` | +| [Splats](https://docs.netlify.com/routing/redirects/redirect-options/#splats) | **{dotted-circle}** No | `/news/* /blog/:splat` | +| Placeholders | **{dotted-circle}** No | `/news/:year/:month/:date/:slug /blog/:year/:month/:date/:slug` | +| Query parameters | **{dotted-circle}** No | `/store id=:id /blog/:id 301` | +| Force ([shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing)) | **{dotted-circle}** No | `/app/ /app/index.html 200!` | +| Domain-level redirects | **{dotted-circle}** No | `http://blog.example.com/* https://www.example.com/blog/:splat 301` | +| Redirect by country or language | **{dotted-circle}** No | `/ /anz 302 Country=au,nz` | +| Redirect by role | **{dotted-circle}** No | `/admin/* 200! Role=admin` | NOTE: **Note:** Supported paths must start with a forward slash `/`. -## Adding redirect configuration +## Create redirects -Add a configuration file named `_redirects` under the `public/` directory of your Pages site. +To create redirects after [enabling](#enable-or-disable-redirects) the feature, +create a configuration file named `_redirects` in the `public/` directory of your +GitLab Pages site. -If you access your GitLab Pages site using the default domain name, for example `namespace.gitlab.io/projectname`, -you will need to prefix every rule with the project name. For example, +If your GitLab Pages site uses the default domain name (such as +`namespace.gitlab.io/projectname`) you must prefix every rule with the project name: ```plaintext /projectname/redirect-portal.html /projectname/magic-land.html 301 @@ -49,9 +60,9 @@ you will need to prefix every rule with the project name. For example, /projectname/pit.html /projectname/spikes.html 302 ``` ---- - -You do not need to prefix the project name if you use [custom domains](custom_domains_ssl_tls_certification/index.md). For example, if your custom domain is `example.com`, your `_redirect` file would look like: +If your GitLab Pages site uses [custom domains](custom_domains_ssl_tls_certification/index.md), +no project name prefix is needed. For example, if your custom domain is `example.com`, +your `_redirect` file would look like: ```plaintext /redirect-portal.html /magic-land.html 301 @@ -60,25 +71,28 @@ You do not need to prefix the project name if you use [custom domains](custom_do /pit.html /spikes.html 302 ``` -## Shadowing (overriding a file) - -Files take priority over a redirect. -If a file exists on disk, then we serve that file instead of your redirect. +## Files override redirects -For example, if you have the files `hello.html` and `world.html` and the following `_redirects` file. The `hello.html` file will be served because the file exists and the redirect rule will be ignored. +Files take priority over redirects. If a file exists on disk, GitLab Pages serves +the file instead of your redirect. For example, if the files `hello.html` and +`world.html` exist, and the `_redirects` file contains the following line, the redirect +is ignored because `hello.html` exists: ```plaintext /projectname/hello.html /projectname/world.html 302 ``` -Netlify has a [force option](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing) -to change this behavior but this is not supported yet. +NOTE: **Note:** +GitLab does not support Netlify's +[force option](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing) +to change this behavior. -## Debugging redirect rules +## Debug redirect rules -If one of your redirects isn't working or you want to check to make sure your syntax is correct, -you can browse to the redirects config itself `https://namespace.gitlab.io/projectname/_redirects`. -The `_redirects` file will not be served directly, instead, it will show a numbered list of your redirect rules and indicate whether the rule is valid or if GitLab Pages encountered an error parsing that line. +If a redirect isn't working as expected, or you want to check your redirect syntax, visit +`https://[namespace.gitlab.io]/projectname/_redirects`, replacing `[namespace.gitlab.io]` with +your domain name. The `_redirects` file isn't served directly, but your browser +displays a numbered list of your redirect rules, and whether the rule is valid or invalid: ```plaintext 11 rules @@ -94,3 +108,22 @@ rule 9: error: no domain-level redirects to outside sites rule 10: valid rule 11: valid ``` + +## Enable or disable redirects + +Redirects in GitLab Pages is under development and not ready for production use. It is +deployed behind a feature flag that is **disabled by default**. +[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md) +can enable it. + +To enable it: + +```ruby +Feature.enable(:FF_ENABLE_REDIRECTS) +``` + +To disable it: + +```ruby +Feature.disable(:FF_ENABLE_REDIRECTS) +``` -- GitLab From 9a9b8acdde6d643d810ef1353325763114f41940 Mon Sep 17 00:00:00 2001 From: Amy Qualls Date: Tue, 15 Sep 2020 13:40:16 -0700 Subject: [PATCH 03/12] Add 'Netlify' to spelling exceptions list This word is valid and should be allowed. --- doc/.vale/gitlab/spelling-exceptions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index f269d02c40731c..1261cf5bae3573 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -284,6 +284,7 @@ namespaces namespacing namespacings Nanoc +Netlify NGINX Nokogiri npm -- GitLab From 86ff2b117beb48f2dc6d93b4411a31fec3deb3a4 Mon Sep 17 00:00:00 2001 From: "Amy Qualls (currently half-days after surgery)" Date: Tue, 15 Sep 2020 20:41:32 +0000 Subject: [PATCH 04/12] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/pages/redirects.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index 82761e50124f27..ace2b5989d9fde 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -1,6 +1,4 @@ --- -type: reference -last_updated: 2020-09-09 stage: Release group: Release Management info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers -- GitLab From 6c43df82704d50c18813c76c862860dca7d06a94 Mon Sep 17 00:00:00 2001 From: "Amy Qualls (currently half-days after surgery)" Date: Tue, 15 Sep 2020 20:41:45 +0000 Subject: [PATCH 05/12] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/pages/introduction.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md index e9c73a9b5f1040..adb187c74f2750 100644 --- a/doc/user/project/pages/introduction.md +++ b/doc/user/project/pages/introduction.md @@ -60,7 +60,8 @@ If the case of `404.html`, there are different scenarios. For example: ## Redirects in GitLab Pages -You can configure redirects for your site using a `_redirects` file. To learn more visit the [redirects documentation](redirects.md). +You can configure redirects for your site using a `_redirects` file. To learn more, read +the [redirects documentation](redirects.md). ## GitLab Pages Access Control **(CORE)** -- GitLab From 3d32782ccc103cca179ce993b205e8636f444843 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 15 Sep 2020 21:11:24 +0000 Subject: [PATCH 06/12] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/pages/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/project/pages/index.md b/doc/user/project/pages/index.md index 57483882a16e8a..dc60b20d7d9b67 100644 --- a/doc/user/project/pages/index.md +++ b/doc/user/project/pages/index.md @@ -59,7 +59,7 @@ To update a GitLab Pages website: | [Explore GitLab Pages](introduction.md) | Requirements, technical aspects, specific GitLab CI/CD configuration options, Access Control, custom 404 pages, limitations, FAQ. | | [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. | | [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. | -| [Redirects](redirects.md) | Set up redirects to forward one page to another | +| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another | Learn more and see examples: -- GitLab From 179495aec92f994629beddd9c5169fedfcbdbbbe Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 16 Sep 2020 11:01:34 -0500 Subject: [PATCH 07/12] Update feature flag docs for redirects --- doc/user/project/pages/index.md | 2 +- doc/user/project/pages/redirects.md | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/doc/user/project/pages/index.md b/doc/user/project/pages/index.md index dc60b20d7d9b67..6c3b911d033a4a 100644 --- a/doc/user/project/pages/index.md +++ b/doc/user/project/pages/index.md @@ -59,7 +59,7 @@ To update a GitLab Pages website: | [Explore GitLab Pages](introduction.md) | Requirements, technical aspects, specific GitLab CI/CD configuration options, Access Control, custom 404 pages, limitations, FAQ. | | [Custom domains and SSL/TLS Certificates](custom_domains_ssl_tls_certification/index.md) | Custom domains and subdomains, DNS records, and SSL/TLS certificates. | | [Let's Encrypt integration](custom_domains_ssl_tls_certification/lets_encrypt_integration.md) | Secure your Pages sites with Let's Encrypt certificates, which are automatically obtained and renewed by GitLab. | -| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another | +| [Redirects](redirects.md) | Set up HTTP redirects to forward one page to another. | Learn more and see examples: diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index ace2b5989d9fde..ab5192ce1e8b1d 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -7,15 +7,14 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Create redirects for GitLab Pages > - [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/24) in GitLab Pages 1.25.0 and GitLab 13.4. -> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default. -> - It's disabled on GitLab.com. -> - It's not recommended for production use. +> - It's [deployed behind a feature flag](#enable-or-disable-redirects), disabled by default. +> - It's enabled on GitLab.com. > - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-redirects). CAUTION: **Warning:** This feature might not be available to you. Check the **version history** note above for details. -In GitLab Pages, you can [enable](#enable-or-disable-redirects) the redirects feature to configure rules for forwarding one URL to another using HTTP redirects. GitLab Pages uses +In GitLab Pages, you can [enable](#enable-or-disable-redirects) the redirects feature to configure rules to forward one URL to another using HTTP redirects. GitLab Pages uses [Netlify style redirects](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file). ## Supported features @@ -111,17 +110,17 @@ rule 11: valid Redirects in GitLab Pages is under development and not ready for production use. It is deployed behind a feature flag that is **disabled by default**. -[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md) -can enable it. -To enable it: +For [Omnibus installations](https://docs.gitlab.com/ee/administration/pages/), define the `FF_ENABLE_REDIRECTS` environment variable via the [global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings). +Add the following line to `/etc/gitlab/gitlab.rb` and [reconfigure the instance](https://docs.gitlab.com/ee/administration/restart_gitlab.html#omnibus-gitlab-reconfigure). ```ruby -Feature.enable(:FF_ENABLE_REDIRECTS) +gitlab_pages['env']['FF_ENABLE_REDIRECTS'] = 'true' ``` -To disable it: +For [source installations](https://docs.gitlab.com/ee/administration/pages/source.html), define the `FF_ENABLE_REDIRECTS` environment variable, then [restart GitLab](https://docs.gitlab.com/ee/administration/restart_gitlab.html#installations-from-source): -```ruby -Feature.disable(:FF_ENABLE_REDIRECTS) +```shell +export FF_ENABLE_REDIRECTS="true" +/path/to/pages/bin/gitlab-pages -config gitlab-pages.conf ``` -- GitLab From 6c7dc5b3c18b4f26f93a60f54ce465375a776a81 Mon Sep 17 00:00:00 2001 From: "Amy Qualls (slowly returning after surgery)" Date: Wed, 16 Sep 2020 16:37:34 +0000 Subject: [PATCH 08/12] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/pages/redirects.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index ab5192ce1e8b1d..e08fb03c774b49 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -111,7 +111,9 @@ rule 11: valid Redirects in GitLab Pages is under development and not ready for production use. It is deployed behind a feature flag that is **disabled by default**. -For [Omnibus installations](https://docs.gitlab.com/ee/administration/pages/), define the `FF_ENABLE_REDIRECTS` environment variable via the [global settings](https://docs.gitlab.com/ee/administration/pages/#global-settings). +For [Omnibus installations](../../../administration/pages/index.md), define the +`FF_ENABLE_REDIRECTS` environment variable in the +[global settings](../../../administration/pages/index.md#global-settings). Add the following line to `/etc/gitlab/gitlab.rb` and [reconfigure the instance](https://docs.gitlab.com/ee/administration/restart_gitlab.html#omnibus-gitlab-reconfigure). ```ruby -- GitLab From 6bd4557ac2a7d2ffd9823da20eaaa049022e85fa Mon Sep 17 00:00:00 2001 From: "Amy Qualls (slowly returning after surgery)" Date: Wed, 16 Sep 2020 16:38:21 +0000 Subject: [PATCH 09/12] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/pages/redirects.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index e08fb03c774b49..1243feb97ca119 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -114,7 +114,8 @@ deployed behind a feature flag that is **disabled by default**. For [Omnibus installations](../../../administration/pages/index.md), define the `FF_ENABLE_REDIRECTS` environment variable in the [global settings](../../../administration/pages/index.md#global-settings). -Add the following line to `/etc/gitlab/gitlab.rb` and [reconfigure the instance](https://docs.gitlab.com/ee/administration/restart_gitlab.html#omnibus-gitlab-reconfigure). +Add the following line to `/etc/gitlab/gitlab.rb` and +[reconfigure the instance](../../../administration/restart_gitlab.md#omnibus-gitlab-reconfigure). ```ruby gitlab_pages['env']['FF_ENABLE_REDIRECTS'] = 'true' -- GitLab From 126d88fcdd72a8fc7f327b4071e2899eb8a52800 Mon Sep 17 00:00:00 2001 From: "Amy Qualls (slowly returning after surgery)" Date: Wed, 16 Sep 2020 16:38:56 +0000 Subject: [PATCH 10/12] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/pages/redirects.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index 1243feb97ca119..161519aab5c0c8 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -121,7 +121,9 @@ Add the following line to `/etc/gitlab/gitlab.rb` and gitlab_pages['env']['FF_ENABLE_REDIRECTS'] = 'true' ``` -For [source installations](https://docs.gitlab.com/ee/administration/pages/source.html), define the `FF_ENABLE_REDIRECTS` environment variable, then [restart GitLab](https://docs.gitlab.com/ee/administration/restart_gitlab.html#installations-from-source): +For [source installations](../../../administration/pages/source.md), define the +`FF_ENABLE_REDIRECTS` environment variable, then +[restart GitLab](../../../administration/restart_gitlab.md#installations-from-source): ```shell export FF_ENABLE_REDIRECTS="true" -- GitLab From fb34b8d6c1e153764856ad4390e405eb988038fa Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 16 Sep 2020 12:45:23 -0500 Subject: [PATCH 11/12] Add admin docs for Pages redirects feature toggle --- doc/administration/pages/index.md | 5 +++++ doc/administration/pages/source.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/doc/administration/pages/index.md b/doc/administration/pages/index.md index f6ff13edabdb65..3c0030be6299a2 100644 --- a/doc/administration/pages/index.md +++ b/doc/administration/pages/index.md @@ -235,6 +235,7 @@ control over how the Pages daemon runs and serves content in your environment. | `pages_path` | The directory on disk where pages are stored, defaults to `GITLAB-RAILS/shared/pages`. | `pages_nginx[]` | | | `enable` | Include a virtual host `server{}` block for Pages inside NGINX. Needed for NGINX to proxy traffic back to the Pages daemon. Set to `false` if the Pages daemon should directly receive all requests, for example, when using [custom domains](index.md#custom-domains). +| `FF_ENABLE_REDIRECTS` | Feature flag to enable redirects. See the [redirects documentation](../../user/project/pages/redirects.md#enable-or-disable-redirects) for more info. | --- @@ -424,6 +425,10 @@ Authority (CA) in the system certificate store. For Omnibus, this is fixed by [installing a custom CA in Omnibus GitLab](https://docs.gitlab.com/omnibus/settings/ssl.html#install-custom-public-certificates). +## Enable redirects + +In GitLab Pages, you can [enable the redirects feature](../../user/project/pages/redirects.md#enable-or-disable-redirects) to configure rules to forward one URL to another using HTTP redirects. + ## Activate verbose logging for daemon Verbose logging was [introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/2533) in diff --git a/doc/administration/pages/source.md b/doc/administration/pages/source.md index 87217b141a48fc..662817e741163e 100644 --- a/doc/administration/pages/source.md +++ b/doc/administration/pages/source.md @@ -347,6 +347,10 @@ world. Custom domains and TLS are supported. 1. Restart NGINX 1. [Restart GitLab](../restart_gitlab.md#installations-from-source) +## Enable redirects + +In GitLab Pages, you can [enable the redirects feature](../../user/project/pages/redirects.md#enable-or-disable-redirects) to configure rules to forward one URL to another using HTTP redirects. + ## NGINX caveats NOTE: **Note:** -- GitLab From 5c750c879d291827a3c4ed34a8616ffa66003783 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 16 Sep 2020 16:52:53 -0500 Subject: [PATCH 12/12] Remove GitLab.com status about redirects (may or may not be active) --- doc/user/project/pages/redirects.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/user/project/pages/redirects.md b/doc/user/project/pages/redirects.md index 161519aab5c0c8..ae7b1b4fa6e1d5 100644 --- a/doc/user/project/pages/redirects.md +++ b/doc/user/project/pages/redirects.md @@ -8,7 +8,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w > - [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/24) in GitLab Pages 1.25.0 and GitLab 13.4. > - It's [deployed behind a feature flag](#enable-or-disable-redirects), disabled by default. -> - It's enabled on GitLab.com. > - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-redirects). CAUTION: **Warning:** -- GitLab