Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/drift-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ jobs:

- name: Run Drift Check
env:
# Mapping GHA Context to Strictness
# production (main) -> fail
# staging (develop/PR) -> fail
# dev/others -> warn
STRICTNESS: ${{
github.ref == 'refs/heads/main' && 'fail' ||
(github.ref == 'refs/heads/develop' || github.event_name == 'pull_request') && 'fail' ||
'warn'
}}
INFISICAL_TOKEN: ${{ secrets.INFISICAL_TOKEN }}
run: npx ts-node scripts/drift-check.ts
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ vars.NETLIFY_SITE_ID }}
run: npm run drift-check
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.env
.env.local
.netlify/
14 changes: 6 additions & 8 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
[functions]
node_bundler = "esbuild"

[[plugins]]
package = "./plugins/netlify-plugin-function-env-guard"

[[headers]]
for = "/*.html"
[headers.values]
Expand All @@ -29,14 +32,9 @@

# Bare-domain → www canonical redirects (HTTP + HTTPS)
[[redirects]]
from = "http://thispagedoesnotexist12345.com/*"
to = "https://www.thispagedoesnotexist12345.com/:splat"
status = 301
force = true

[[redirects]]
from = "https://thispagedoesnotexist12345.com/*"
to = "https://www.thispagedoesnotexist12345.com/:splat"
hostname = "www.corporate-games.tech"
from = "/*"
to = "https://corporate-games.tech/:splat"
status = 301
force = true
Comment on lines 33 to 39

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## netlify.toml excerpt\n'
nl -ba netlify.toml | sed -n '25,45p'

printf '\n## search for redirect-related keys\n'
rg -n 'hostname|redirects|from =|to =' netlify.toml

Repository: palmtr3man/thispagedoesnotexist12345

Length of output: 239


🌐 Web query:

Netlify netlify.toml redirects hostname key documented from full origin hostname ignored

💡 Result:

There is no "hostname" key in the Netlify netlify.toml redirect configuration syntax [1][2]. Netlify's official documentation for [[redirects]] does not support a hostname property to filter or match traffic based on the origin hostname [1][2]. If you are attempting to redirect based on a specific hostname (domain), you should include the full URL (including the protocol and hostname) within the from property of your redirect rule [3]. For example: [[redirects]] from = "https://example.com/*" to = "https://destination.com/:splat" status = 301 force = true If your redirects are being ignored, it is typically due to one of the following reasons: 1. Precedence and File Shadowing: Redirects in a _redirects file (located in your publish directory) are processed before those in netlify.toml [4]. If a rule in _redirects or a system-generated rule (e.g., from a framework like Next.js or Nuxt) matches the path first, subsequent rules may never be evaluated [5][4]. 2. Framework Runtime Overrides: If you are using a framework with a specialized runtime (like Next.js), the framework may generate its own internal redirects and rewrites that take precedence over your netlify.toml rules [5][3]. 3. Syntax Issues: Ensure you are using force = true if you need the redirect to override existing files (preventing file shadowing) [2][6]. If you suspect your rules are being ignored due to host-based matching, ensure you are specifying the full origin in the from field as shown above, rather than attempting to use an unsupported hostname key [3].

Citations:


Use the full origin in from
hostname isn’t a valid [[redirects]] field here, so this rule won’t scope to www.corporate-games.tech. Use the full URL in from instead.

Proposed fix
[[redirects]]
-  hostname = "www.corporate-games.tech"
-  from = "/*"
+  from = "https://www.corporate-games.tech/*"
  to = "https://corporate-games.tech/:splat"
  status = 301
  force = true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Bare-domain → www canonical redirects (HTTP + HTTPS)
[[redirects]]
from = "http://thispagedoesnotexist12345.com/*"
to = "https://www.thispagedoesnotexist12345.com/:splat"
status = 301
force = true
[[redirects]]
from = "https://thispagedoesnotexist12345.com/*"
to = "https://www.thispagedoesnotexist12345.com/:splat"
hostname = "www.corporate-games.tech"
from = "/*"
to = "https://corporate-games.tech/:splat"
status = 301
force = true
[[redirects]]
from = "https://www.corporate-games.tech/*"
to = "https://corporate-games.tech/:splat"
status = 301
force = true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@netlify.toml` around lines 33 - 39, The redirect rule is using an invalid
hostname field and therefore won’t match only the www origin. Update the
redirect entry in netlify.toml to scope the rule via the full origin in the from
field, and keep the existing destination and 301 force behavior intact. Use the
[[redirects]] block to locate the rule and remove the hostname-based scoping
from that redirect.


Expand Down
Loading