# Dynamic redirect to URL based on application name?

**URL:** <https://community.auth0.com/t/dynamic-redirect-to-url-based-on-application-name/108564>\
**Category:** Get Help\
**Tags:** email-templates-branding, branding\
**Created:** [June 5, 2023, 2:04pm UTC](https://community.auth0.com/t/dynamic-redirect-to-url-based-on-application-name/108564 "2023-06-05T14:04:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aayushmau5](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aayushmau5/32/47685_2.png) [@aayushmau5](https://community.auth0.com/u/aayushmau5)\
**Post date:** [June 5, 2023, 2:04pm UTC](https://community.auth0.com/t/dynamic-redirect-to-url-based-on-application-name/108564/1 "2023-06-05T14:04:06Z")

</div>

Hi!  
Some context: I have three applications named: `local`, `stage` and `prod`. Whenever a user signs up in my application, Auth0 sends them a verification email. I want the user to get redirected to a particular URL based on how they sign up(either locally, through stage or prod).  
I tried doing this by configuring the Redirect To field in verification email dashboard. Like this:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/d/4/d46744ca53364c87c4e2710127241042d25f6d07.png)

Here’s the full value:

```auto
{% if application.name == 'local' %} http://localhost:4000/local {% elsif application.name == 'stage' %} https://<link-to-stage-app> {% else %} https://<link-to-prod> {% endif %}

```

But this doesn’t work. I always get redirected to prod link after verifying my email. What did I do wrong here? What should be the correct approach?

Thanks!

---

<div class="post-metadata">

**Author:** ![aayushmau5](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aayushmau5/32/47685_2.png) [@aayushmau5](https://community.auth0.com/u/aayushmau5)\
**Post date:** [June 10, 2023, 6:32pm UTC](https://community.auth0.com/t/dynamic-redirect-to-url-based-on-application-name/108564/2 "2023-06-10T18:32:41Z")

</div>

Solved it on my own! I didn’t realize my application name contained spaces 🤦‍♂️

PS: The syntax above will work just fine. However, if you have spaces in your application name, the comparison should have encoded spaces. Ex. `application.name == 'local%20app'` instead of `local app`.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 12, 2023, 6:58am UTC](https://community.auth0.com/t/dynamic-redirect-to-url-based-on-application-name/108564/3 "2023-06-12T06:58:50Z")

</div>

Glad you have figured it out and thanks for sharing with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 26, 2023, 6:59am UTC](https://community.auth0.com/t/dynamic-redirect-to-url-based-on-application-name/108564/4 "2023-06-26T06:59:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
