# RedirectUrl rules (Redirect to a specific page according to user)

**URL:** <https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001>\
**Category:** Get Help\
**Tags:** redirect, redirect-rules\
**Created:** [December 16, 2017, 10:26pm UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001 "2017-12-16T22:26:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kj1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kj1](https://community.auth0.com/u/kj1)\
**Post date:** [December 16, 2017, 10:26pm UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001/1 "2017-12-16T22:26:43Z")

</div>

Great job on Auth0, it gets better and better the more I delve deeper.

Here’s my question:  
Is it possible to redirect according to the login email address?  
Example:

- [user1@example1.com](mailto:user1@example1.com) gets redirected to [data.example1.com](http://data.example1.com) after login
- [user2@example2.com](mailto:user2@example2.com) gets redirected to [data.example2.com](http://data.example2.com) after login

(Same auth0 client and database. It doesn’t matter if I use the Centralized login or Embedded login.)

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 18, 2017, 6:03pm UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001/2 "2017-12-18T18:03:25Z")

</div>

Redirects are almost like layers of abstraction… you can always have one more (sometimes at the cost of increased complexity) so technically, yes, you can achieve that.

A few things to have in mind is that the OIDC/OAuth 2.0 authentication that you’re likely relying already defines some redirects in order to complete the authentication flow and those redirects have to follow some rules. In particular, a client application needs to specify a redirect URL that was previously registered (white-listed) with the authorization server, otherwise, the request fails.

The above implies that if you want to redirect each user to a different URL the only way to accomplish this within the OIDC/OAuth2 redirects would be to register them all; this would likely not scale so **the recommendation would be that your client application has a central redirect URL used for OIDC/OAuth2 authentication and then upon successful authentication performs a final redirect based on the end-user that just completed authentication.**

---

<div class="post-metadata">

**Author:** ![kj1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kj1](https://community.auth0.com/u/kj1)\
**Post date:** [December 18, 2017, 6:24pm UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001/3 "2017-12-18T18:24:54Z")

</div>

Is there some doc article that you recommend on this subject?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 18, 2017, 11:08pm UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001/4 "2017-12-18T23:08:14Z")

</div>

There is [this documentation](https://auth0.com/docs/users/redirecting-users) page, but I think is more aimed at other scenarios where the final redirect is not so much based on an end-user, but instead contextual to what they were doing before authentication.

---

<div class="post-metadata">

**Author:** ![kj1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kj1](https://community.auth0.com/u/kj1)\
**Post date:** [December 19, 2017, 4:43am UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001/5 "2017-12-19T04:43:51Z")

</div>

Quick question: is it safe to expose the clientID?

I’m using the following URL form to get the centralized login page:

https://AUTH0\_DOMAIN//login?client=CLIENT\_ID

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/redirecturl-rules-redirect-to-a-specific-page-according-to-user/9001/6 "2018-03-02T05:57:50Z")

</div>


