<p>So after a bit of trial an error, setting a protocol for the <code>siteUrl</code> in <code>config/general.php</code> fixed it! </p>

<p>Ex. I had <code>'siteUrl' =&gt; 'domain.tld'</code> so I changed it to <code>'siteUrl' =&gt; '//domain.tld'</code> and all is well.</p>

CC BY-SA 4.0
2018-10-09T02:31:21.873Z
2018-10-09T02:31:21.873Z
stojda
<p>I have a logout button on my site that points to the <code>logoutUrl</code>. </p>

<p>While the logout works and ends the user session, the user is brought to a page with the URL similar to <code>domain.tld/domain.tld/</code> where domain.tld is my test-server's domain. </p>

<p>Naturally, this results in a 404 since I don't have a template to render a matching URL.</p>

<p>Any idea how to fix this or what could be causing it? </p>

<p>Thanks!</p>

<craft3><users><session><usermodel>
Craft redirects to domain.tld/domain.tld/ on logout
# Craft redirects to domain.tld/domain.tld/ on logout

(Asked by: username_0 on 2018-10-07)

I have a logout button on my site that points to the `logoutUrl`.

While the logout works and ends the user session, the user is brought to a page with the URL similar to `domain.tld/domain.tld/` where domain.tld is my test-server's domain.

Naturally, this results in a 404 since I don't have a template to render a matching URL.

Any idea how to fix this or what could be causing it?

Thanks!

**Tags:** craft3, users, session, usermodel

---

## 1 answers

### Answer by username_0 on 2018-10-09. Score: 1 | Accepted answer

So after a bit of trial an error, setting a protocol for the `siteUrl` in `config/general.php` fixed it!

Ex. I had `'siteUrl' => 'domain.tld'` so I changed it to `'siteUrl' => '//domain.tld'` and all is well.


---

