# Realm Frontend URL for Users

**URL:** <https://forum.keycloak.org/t/realm-frontend-url-for-users/17254>\
**Category:** Configuring the server\
**Created:** [September 6, 2022, 1:07pm UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254 "2022-09-06T13:07:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![belfhi](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/belfhi/32/1690_2.png) [@belfhi](https://forum.keycloak.org/u/belfhi)\
**Post date:** [September 6, 2022, 1:07pm UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/1 "2022-09-06T13:07:49Z")

</div>

Hello,  
I would like to configure my  
Keycloak to use a different URL for a Realm.  
In the `Realm Settings` tab there is an option  
for _Frontend URL_ but when I set it to a value and  
create a new _ingress_ record the account console  
won’t load.  
In the help field it says to use the frontend url in combination  
with the default hostname provider.  
Does anyone have documentation on how this works?  
Much appreciated,  
Johannes

---

<div class="post-metadata">

**Author:** ![matissime](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matissime](https://forum.keycloak.org/u/matissime)\
**Post date:** [February 2, 2023, 11:07pm UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/2 "2023-02-02T23:07:59Z")

</div>

I’m in the same issue with you, I want to setup a different URl for a specific Realm, but when I tried to set the frontend value to the URl I want, it simply doesn’t work, and I already configured all the proper redirection for the domain name that I want to use.

---

<div class="post-metadata">

**Author:** ![NoahNL](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/noahnl/32/9134_2.png) [@NoahNL](https://forum.keycloak.org/u/NoahNL)\
**Post date:** [March 1, 2024, 1:06pm UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/3 "2024-03-01T13:06:19Z")

</div>

Sorry for reviving this thread but I am in the same position right now. Did you manage to set a different url for your realms?

---

<div class="post-metadata">

**Author:** ![ashish-online](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@ashish-online](https://forum.keycloak.org/u/ashish-online)\
**Post date:** [March 26, 2024, 2:27am UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/4 "2024-03-26T02:27:53Z")

</div>

I set the

```auto
KC_HOSTNAME_URL: https://login.domain1
KC_HOSTNAME_ADMIN_URL: https://admin.domain1
KC_ADMIN_URL: https://admin.domain1

```

I have 3 realms and their corresponding frontend urls are:

1. Master: `https://admin.domain1`
2. Domain1: `https://login.domain1`
3. Domain2: `https://login.domain2`

---

<div class="post-metadata">

**Author:** ![nishit93-hub](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/nishit93-hub/32/10626_2.png) [@nishit93-hub](https://forum.keycloak.org/u/nishit93-hub)\
**Post date:** [June 11, 2024, 5:39am UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/5 "2024-06-11T05:39:09Z")

</div>

@ashish-online

I added a frontend URL “[auth.mydomain.com](http://auth.mydomain.com)” to have a realm on a different URL. Also set the KC\_HOSTNAME\_URL= **[auth.mydomain.com](http://auth.mydomain.com)** I have been getting below-error

`ERROR [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (executor-thread-118) Failed to parse realm frontendUrl 'auth.mydomain.com'. Falling back to global value.: java.lang.IllegalArgumentException: The url [frontendUrl] is malformed`

---

<div class="post-metadata">

**Author:** ![ziik](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/ziik/32/11082_2.png) [@ziik](https://forum.keycloak.org/u/ziik)\
**Post date:** [August 12, 2024, 7:55am UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/6 "2024-08-12T07:55:53Z")

</div>

@ashish-online and when you type in browser “login.domain2” than redirect it to login form on address login.domain2/reallm/domain2/protocol/open… ?

@nishit93-hub Frontend URL maybe must be in full format like “[https://domain:443](https://domain:443)”.

---

<div class="post-metadata">

**Author:** ![lamoboos223](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lamoboos223/32/9748_2.png) [@lamoboos223](https://forum.keycloak.org/u/lamoboos223)\
**Post date:** [August 13, 2024, 9:24am UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/7 "2024-08-13T09:24:31Z")

</div>

Why would you set the urls from keycloak instead instead of a gateway or reverse proxy?

---

<div class="post-metadata">

**Author:** ![ziik](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/ziik/32/11082_2.png) [@ziik](https://forum.keycloak.org/u/ziik)\
**Post date:** [August 14, 2024, 8:55am UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/8 "2024-08-14T08:55:19Z")

</div>

Keycloak is already doing a redirect, but to master the realm…which doesn’t make sense. It should redirect to the realm defined by the domain used in the URL.

You propose to fix the behavior of the application by adding a second application with the sole purpose of rewriting the path for one defined address. And you want to call it the right solution? It looks like a workaround to me 🙂

---

<div class="post-metadata">

**Author:** ![lamoboos223](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lamoboos223/32/9748_2.png) [@lamoboos223](https://forum.keycloak.org/u/lamoboos223)\
**Post date:** [August 14, 2024, 4:01pm UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/9 "2024-08-14T16:01:15Z")

</div>

I didn’t propose it as a solution, but i just knew keycloak sets urls. I thought that would be the reverse proxy job that’s it.

@ziik

---

<div class="post-metadata">

**Author:** ![ziik](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/ziik/32/11082_2.png) [@ziik](https://forum.keycloak.org/u/ziik)\
**Post date:** [August 15, 2024, 7:17pm UTC](https://forum.keycloak.org/t/realm-frontend-url-for-users/17254/10 "2024-08-15T19:17:40Z")

</div>

I dig little in source code and … redirect is controled by attribute “redirectToAdmin” in the “welcome” theme. But there is just one “welcome” theme at all. It looks like application does not know realm base on Frontend URL at beginning.

[github](https://github.com/keycloak/keycloak/blob/db42bb1aeb77adf26063102f3519e66bc8c931a0/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java#L187)

It is possible overwrite theme and turn off the redirect. But it effects all URLs … so the URL to master realm too (it is not what we want).

[StackOverflow](https://stackoverflow.com/questions/78251173/keycloak-how-to-override-welcome-screen-redirect-behavior-to-custom-realm-ins)

The right way looks to me, in case Frontend URL is set than should be “welcome” theme specified to this realm. And used according by hostname in the URL.
