# Custom domain "redirected you too many times." error

**URL:** <https://community.auth0.com/t/custom-domain-redirected-you-too-many-times-error/47716>\
**Category:** Get Help\
**Tags:** auth0-php, custom-domain, auth0\
**Created:** [August 9, 2020, 9:44pm UTC](https://community.auth0.com/t/custom-domain-redirected-you-too-many-times-error/47716 "2020-08-09T21:44:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evanstp](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@evanstp](https://community.auth0.com/u/evanstp)\
**Post date:** [August 9, 2020, 9:44pm UTC](https://community.auth0.com/t/custom-domain-redirected-you-too-many-times-error/47716/1 "2020-08-09T21:44:56Z")

</div>

We’re using a custom domain with Auth0, however, when we initiate our Auth0 SDK and call login(), we get redirected to the Universal Login page where the domain is correct, params look good etc, but the browser cancels the request with “too many redirects” error. Pretty basic code (PHP):

```
$auth0 = new Auth0(array(
        'domain' => AUTH0_DOMAIN,
        'client_id' => AUTH0_CLIENT_ID,
        'client_secret' => AUTH0_CLIENT_SECRET,
        'redirect_uri' => SITE_URL . 'auth',
        'audience' => 'https://' . AUTH0_DOMAIN . '/userinfo',
        'scope' => 'openid profile'
    ));

$auth0->login();

```

---

<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:** [August 10, 2020, 7:14am UTC](https://community.auth0.com/t/custom-domain-redirected-you-too-many-times-error/47716/2 "2020-08-10T07:14:09Z")

</div>

Hey there @evanstp!

Can I ask you to raise it as a GitHub issue in the auth0 PHP SDK repo so we can work on that effectively with the repo maintainers? Make sure to share the link to the issue with us once you have it so we can ping them. Thanks!
