forked from endoflife-date/endoflife.date
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_redirects
More file actions
56 lines (51 loc) · 2.43 KB
/
_redirects
File metadata and controls
56 lines (51 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
# Netlify _redirects template. Documentation can be found on https://docs.netlify.com/routing/redirects/.
#
# The _redirects file is included in _config.yml/include key otherwise Jekyll doesn't copy it to
# _site directory, where Netlify expects it.
#
# To create a new redirect, add an alternate_urls array in the page front-matter.
# Setting a layout forces Jekyll to render this file
layout: null
---
{% for page in site.pages -%}
# Redirects for {{page.path}}
{%- if page.alternate_urls %}
{%- for url in page.alternate_urls %}
{{url}} {{page.permalink}}
{%- endfor %}
{%- endif %}
{%- if page.layout == 'product' %}
{{page.permalink}}/_edit https://github.com/endoflife-date/endoflife.date/edit/master/{{page.path}}
{%- comment %}API v0 redirect{% endcomment %}
/api{{page.permalink}} /api{{page.permalink}}.json
{%- if page.alternate_urls %}
{%- for url in page.alternate_urls %}
/calendar{{url}}.ics /calendar{{page.permalink}}.ics
/api{{url}}.json /api{{page.permalink}}.json
/api{{url}}/* /api{{page.permalink}}/:splat
/api/v1/products{{url}}/* /api/v1/products{{page.permalink}}/:splat
{%- endfor %}
{%- endif %}
{%- endif %}
{% endfor %}
# Clients will try to access /favicon.ico, in some scenarios we don't want the file in our codebase,
# because the theme embeds it as a favicon, so instead set a redirect for these clients to a PNG file instead.
/favicon.ico /assets/favicon-32x32.png
# Rewrite for /api/v1/ to keep URLs clean.
# All API responses are located in an index.json and must be accessible without the file name, such as:
# - /api/v1/index.json -> /api/v1/
# - /api/v1/products/almalinux/index.json -> /api/v1/products/almalinux/
# This uses shadowing : https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing, and
# it must be declared at the end of the file to not take precedence on the redirects (see
# https://docs.netlify.com/routing/redirects/#rule-processing-order).
/api/v1/* /api/v1/:splat/index.json 200!
# A few permanent redirects for removed pages
/tags/api-gateway /tags/web-server
/tags/configuration-management /
/tags/db /tags/database
/tags/library /tags/framework
/tags/managed-mysql /tags/database
/tags/managed-postgresql /tags/database
/tags/package-manager /tags/build-tool
/tags/redhat /tags/red-hat