Supporting Multiple Domains #4
Unanswered
mackensiealvarezz
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I hope this message finds you well. I’m using your package to build a URL shortening application, and it’s been incredibly helpful so far—thank you for your work!
I have a use case where I need to support multiple domains for the shortened URLs. For example:
app.com/xxx
abc.com/xxx
xyz.com/xxx
Requirements:
Each shortened URL should be tied to a specific domain, allowing customers to select which domain to use for their short URLs.
The application should be able to resolve and redirect based on the incoming domain and short code combination.
Ideally, customers should also be able to bring their custom domains to the system, and the application should support routing for these custom domains as well.
Questions:
Does the package currently have built-in support for handling multiple domains, or would I need to extend its functionality?
Can the domain be tied to the shortened URL in some way, such as a database field or configuration?
What would be the best approach to ensure that the application recognizes the incoming domain (Host header) and routes the request to the correct long URL?
Proposed Approach:
I was considering adding a domains table in my database to store the available domains and linking it to the short URL records. The application would then check the Host header of incoming requests to determine the domain and resolve the corresponding short code.
However, I’m unsure how this approach aligns with the package's current capabilities or if there’s a better way to implement this functionality using your package.
I’d greatly appreciate any advice or suggestions you have for implementing this feature effectively.
Thank you for your time and for creating such a great package!
Beta Was this translation helpful? Give feedback.
All reactions