Open steven-tey opened 10 months ago
Hi steven! Can we leverage the redirects configuration in next.config.js?
module.exports = { async redirects() { return [ { source: '/doma.in/:path', // Match any path starting with '/doma.in/' destination: 'https://domain.com/products/:path', // Preserve the original path permanent: false, // Optional: Set to true for a permanent (308) redirect }, ]; }, };
Hi @hemant-code625! That won't be possible in our case since we're using edge middleware to handle redirects. We'll also have to rethink our existing redirect logic (GET
a kv-pair from Redis and redirect if exists) and adapt that to this use case.
Thank you @steven-tey for clarifying. Let me learn about this edge middleware and our codebase, I'll be back to resolve this issue soon.
Some ideas:
rule: true
)alias_link_Id
?@steven-tey as we talked about via email, I'm sharing my input here.
We would love wildcards in links - for instance domain/introduction-deck/* - for which we could input anything, e.g. introduction-deck/clientA, introduction-deck/clientB. It would always redirect to the parent link /introduction-deck but track each child link (the wildcard). This makes it much faster for our sales team to share material without needing to create new links.
For analytics, initially a simple table view would be fine. A more advanced solution would be two analytics pages: 1) parent links and 2) child links which required a selection of a parent through a dropdown or similar. The advanced solution might not be feasible with the overall product direction, so a REST API to extract data would also be just fine (i.e. GET call with date params to get all links with analytics per day - we can parse the rest).
Appreciate the input here @lessthomas 🙏
Ability to define a redirect rule for a given route pattern instead of manually defining all the links.
E.g.
doma.in/:path
→ domain.com/products/:pathUse case: ShareGPT → https://shareg.pt/bPdEf2F redirects to https://sharegpt.com/c/bPdEf2F