{"id":15931560,"url":"https://github.com/zachleat/reverse-proxy-test","last_synced_at":"2026-01-02T22:56:44.185Z","repository":{"id":137956748,"uuid":"295532895","full_name":"zachleat/reverse-proxy-test","owner":"zachleat","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-14T22:50:22.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T00:41:17.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zachleat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-14T20:36:19.000Z","updated_at":"2020-09-16T18:21:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"889f015f-bb7d-49e6-8a38-5c3cd42d0800","html_url":"https://github.com/zachleat/reverse-proxy-test","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"b5c28cec7276683b8ae403f76f2330f55011a7fb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Freverse-proxy-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Freverse-proxy-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Freverse-proxy-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Freverse-proxy-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachleat","download_url":"https://codeload.github.com/zachleat/reverse-proxy-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871652,"owners_count":20361378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T01:21:34.723Z","updated_at":"2026-01-02T22:56:44.140Z","avatar_url":"https://github.com/zachleat.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redirect Tests on Netlify\n\n`_redirects` file syntax test cases. Assumes that we _want_ the trailing slash.\n\n## TL;DR\n\n* [Trailing slashes are added as expected and documented on Netlify](https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash) _EXCEPT_ when a Rewrite rule is in play. If a `200!` Rewrite rule is applied to the URL, the trailing slash redirect does not apply.\n\t* 🚨 `_redirects` file entry `/redirect /dir/ 200!` does not add the trailing slash as expected when `/redirect` is requested. I believe it _should_ 301 to `/redirect/`.\n\t* Is this quirk being relied on in production to workaround the trailing slash normalization? See https://flaviocopes.com/netlify-fix-trailing-slash-rewrite/\n* _Optional:_ `index.html` requests must have a separate entry in your `_redirects` file and handled manually. It would be better if `/index.html` was normalized to `/` for the developer.\n\n## First test\n\nRewrite to another Netlify project.\n\n### `_redirects` Contents\n\n```\n/ https://a-single-html-file.netlify.app/ 200!\n/dir/ https://a-single-html-file.netlify.app/ 200!\n```\n\n### Test Results\n\n* ✅ `/` is 200\n* 💔 `/index.html` is 404 (want to redirect to `/`)\n* 💔 `/dir` is 200 (want to redirect to `/dir/`)\n* ✅ `/dir/` is 200\n* 💔 `/dir/index.html` is 404 (want to redirect to `/dir/`)\n\n## Second test\n\nRewrite to another Netlify project but with manual 301 redirects for `index.html` requests.\n\n### `_redirects` Contents\n\n```\n/index.html / 301!\n/ https://a-single-html-file.netlify.app/ 200!\n\n/dir/index.html /dir/ 301!\n/dir/ https://a-single-html-file.netlify.app/ 200!\n```\n\n### Test Results\n\n* ✅ `/` is 200 \n* ✅ `/index.html` is 301 to `/`\n* 💔 `/dir` is 200 (want to redirect to `/dir/`)\n* ✅ `/dir/` is 200\n* ✅ `/dir/index.html` is 301 to `/dir/`\n\nSame results when Pretty URLs Asset Optimization is enabled (found at `https://app.netlify.com/sites/SITE_NAME/settings/deploys`).\n\n\n## Third test\n\nRewrite to local project file. Uses a `/localdir/index.html` local project file as a control.\n\n### `_redirects` Contents\n\n```\n/localredirect/index.html /localredirect/ 301!\n/localredirect/ /localdir/ 200!\n```\n\n### Test Results\n\n* ✅ `/localdir` is 301 to `/localdir/` (this is what we want the rewrite request to do)\n* ✅ `/localdir/` is 200\n* 💔 `/localredirect` is 200 (we want a 301 to `/localredirect/`)\n* ✅ `/localredirect/` is 200\n* ✅ `/localredirect/index.html` is 301 to `/localredirect/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachleat%2Freverse-proxy-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachleat%2Freverse-proxy-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachleat%2Freverse-proxy-test/lists"}