[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live) [Help](/c/help/9) # How to differ between multiple domains in project? #11872 223 views · 2 likes · 6 posts Serhii (@subproject22-gmailco) · 2024-07-17 How can I tell which base URL to use `my-app.vercel.app`, `my-app.com` or `some-other-domain.com` in single project? You variables only point on last domain I added in project. This breaks auth URL completelybecause I can't differ between domain and tell which one to use. I can't use `req.header.host` because I call function outside of request route context, it's in `utils` If there's no way, why you offer multiple domains in project? 01 Amy Egan (@amyegan) · 2024-07-17 Hey @subproject22-gmailco. You can use [System Environment Variables](https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables) to get a few different URL options. - `VERCEL_URL` is the [generated deployment URL](https://vercel.com/docs/deployments/generated-urls) unique to the visited deployment. - `VERCEL_BRANCH_URL` is the [generated Git branch URL](https://vercel.com/docs/deployments/generated-urls#url-with-git-branch) which is connected to the latest successful deployment from a Git branch. - `VERCEL_PROJECT_PRODUCTION_URL` is a production domain name of the project. It will either be the shortest production custom domain, or `vercel.app` domain if no custom domain is available. This will be set to a current production domain even on preview deployments. Serhii (@subproject22-gmailco) · 2024-07-17 This will not work for what I ask VERCEL_URL - returns commit deployement URL with hash, not static domain generated by Vercel like `my-app.vercel.app` VERCEL_BRANCH_URL - I don't need branch URL VERCEL_PROJECT_PRODUCTION_URL - returns my-app.com How do I get correct URL when I open `my-app.vercel.app` or `some-other-domain.com`? Amy Egan (@amyegan) · 2024-07-17 Since you're trying to use a fixed domain, you could use `VERCEL_ENV` to detect the environment and set a variable in the app based on the current environment. Can you help me understand why you need the `my-app.vercel.app` domain when your project uses a custom `my-app.com` domain? I may be able to help you find another solution if I know more about the larger goal. Serhii (@subproject22-gmailco) · 2024-07-17 · ♥ 1 I think I've found the right way to do it. By using different branches and assigning different domains and variables for each branch. Probably I just tried to use it the wrong way initially, but to tell the truth, your docs lacks the examples of typical usage. I am not a backend or DevOps, hence the difficulties to figuring it out myself without proper docs. Sorry about my frustration, and thank you for your patience Amy 🙌 Amy Egan (@amyegan) · 2024-07-18 · ♥ 1 I'm happy you found a solution! Thanks for talking through the problem solving phase with me. :grin: