# From the Universal Login page, is it possible to redirect a user with a specific domain to an old non-Auth0 login page?

**URL:** <https://community.auth0.com/t/from-the-universal-login-page-is-it-possible-to-redirect-a-user-with-a-specific-domain-to-an-old-non-auth0-login-page/55908>\
**Category:** Get Help\
**Tags:** login\
**Created:** [January 8, 2021, 4:20pm UTC](https://community.auth0.com/t/from-the-universal-login-page-is-it-possible-to-redirect-a-user-with-a-specific-domain-to-an-old-non-auth0-login-page/55908 "2021-01-08T16:20:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![declan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/declan/32/26837_2.png) [@declan](https://community.auth0.com/u/declan)\
**Post date:** [January 11, 2021, 5:31pm UTC](https://community.auth0.com/t/from-the-universal-login-page-is-it-possible-to-redirect-a-user-with-a-specific-domain-to-an-old-non-auth0-login-page/55908/4 "2021-01-11T17:31:03Z")

</div>

Thanks for the quick reply @dan.woda. Much appreciated!

The problem with doing this from my application is that it would put the decision making in my application. Whereas it is more desirable to use the Universal Login page - and related Auth0 connections - as the source of auth decision making (as much as possible, of course).

I have taken a look at some other docs and forum posts. How about this solution…

- Have a Auth0 **Database** connection, elect to “Use my own database” under the Custom Database settings, then add a **Login** script with something like the following pseudocode:

And then in an Auth0 rule do something like…

```
  if (user.reject_login_attempt) {
        context.redirect = {
          url: "https://legacy_auth_server/old_login_page"
        };
        return callback(null, null, context); // It may make sense to pass user as the 2nd arg here instead of null
    } else {
      return callback(null, user, context);
    }

```

Resources:

- The redirect idea in the context was noted here [UnauthorizedError not returning error](https://community.auth0.com/t/unauthorizederror-not-returning-error/21375)
- Here are the related docs on redirecting from within a rule [https://auth0.com/docs/rules/redirect-users?\_ga=2.13958007.1716788289.1610359780-530603537.1604326164](https://auth0.com/docs/rules/redirect-users?_ga=2.13958007.1716788289.1610359780-530603537.1604326164)

@dan.woda Does that seem reasonable? Are there some pitfalls with this approach? I notice that the user still appears in the list of users in Auth0 - is it possible to prevent this?

Kind regards,  
Declan

---

_[View the full topic](https://community.auth0.com/t/from-the-universal-login-page-is-it-possible-to-redirect-a-user-with-a-specific-domain-to-an-old-non-auth0-login-page/55908)._
