Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Improve redirects documentation with advanced regex patterns

Summary

Enhanced the redirects documentation based on user feedback about difficulty configuring complex regex-based redirects. The user specifically mentioned:

  • Needing Claude's help to configure regex redirects
  • Lacking detail about named capture groups
  • Path-to-RegExp docs being insufficient for their use case

Changes made to fern/snippets/redirects.mdx:

  • Added "Advanced patterns" section with named capture group examples
  • Documented the {0} literal delimiter syntax for separating parameters
  • Included real-world examples (release notes migration, versioned APIs)
  • Added pattern syntax reference table
  • Updated link text from "regex" to "Path-to-RegExp" for clarity

Review & Testing Checklist for Human

  • Verify redirect syntax is correct - Test the advanced pattern examples in an actual docs.yml to ensure they work (especially the {0} delimiter and double backslashes)
  • Check regex escaping - Confirm that \\d{4} and similar patterns are properly escaped for YAML
  • Test named capture group reuse - Verify that captured parameters (:year, :month, etc.) can actually be referenced in destination URLs as shown
  • Review against Path-to-RegExp docs - Cross-check that our examples align with Path-to-RegExp actual behavior

Recommended test plan:

  1. Create a test docs.yml with the new advanced redirect examples
  2. Deploy to a preview environment
  3. Test that URLs like /release-notes/2024-12 redirect correctly to /docs/release-notes/2024/12/1

Notes

  • These improvements address direct user feedback from a customer who struggled with complex redirect configuration
  • The examples are based on their actual use case (migrating old release notes URLs)
  • I could not test these locally, so manual verification is important

Session: https://app.devin.ai/sessions/3ac1263b00304808bdeffdb336395807
Requested by: danny@buildwithfern.com (@dannysheridan)

- Add named capture group examples with regex patterns
- Document Path-to-RegExp syntax including {0} delimiter
- Include real-world examples (release notes, versioned APIs)
- Add pattern syntax reference table
- Based on user feedback about complex regex redirects

Co-Authored-By: danny@buildwithfern.com <danny@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

@dannysheridan dannysheridan self-requested a review October 17, 2025 03:14
@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant