Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-09T02:31:21.873Z
Answers.LastActivityDate: 2018-10-09T02:31:21.873Z
Answers.UserDisplayName: stojda
Body: <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>
  
Tags: <craft3><users><session><usermodel>
Title: Craft redirects to domain.tld/domain.tld/ on logout
ThreadText: # 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.
  
  
  ---
  
  