Answers.Body: <p>Well you could prepend the current locale to the redirect string with the craft.locale variable </p>
  
  <pre><code>&lt;input type="hidden" name="redirect" value="{{craft.locale}}/thanks?from={fromName}"&gt;
  </code></pre>
  
  <p>In Craft 3 the redirect parameters need to be hashed and craft.locale is deprecated so we need to use craft.app.language. So when using the input tag you could do it like this</p>
  
  <pre><code>{% set redirectParam = craft.app.language ~ '/thanks?from={fromName}' %}
  
  &lt;input type="hidden" name="redirect" value="{{redirectParam | hash}}"&gt;
  </code></pre>
  
  <p>or use the built in helper function </p>
  
  <pre><code>{{ redirectInput(craft.app.language ~ '/thanks?from={fromName}') }}
  </code></pre>
  
  <p>other option would be to prepend the baseUrl of the current site ( craft3 )</p>
  
  <pre><code>{% set baseUrl = craft.app.sites.currentSite.baseUrl ? craft.app.sites.currentSite.baseUrl : '/' %}
  
  {{ redirectInput(baseUrl ~ '/thanks?from={fromName}') }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-11T22:09:43.653Z
Answers.LastActivityDate: 2018-08-13T03:30:44.203Z
Answers.LastEditDate: 2018-08-13T03:30:44.203Z
Answers.UserDisplayName: Sean Tilley
Answers.Body: <p>Remove 'usePathInfo' => true, from your /craft/config/general.php</p>
  
  <p>This fixed a similar error on my site. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-27T09:40:53.123Z
Answers.Text: I don't use that setting in my config.
Answers.UserDisplayName: Tom De Smet
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-26T12:50:34.510Z
Answers.LastActivityDate: 2015-06-26T12:50:34.510Z
Answers.UserDisplayName: Peter Zilka
Body: <p>I'm using the standard P&amp;T contact form plugin. I have a website with 3 locales in a folder structure where every locale has its own folder:</p>
  
  <p>Public</p>
  
  <p>-- EN</p>
  
  <p>-- FR</p>
  
  <p>-- NL</p>
  
  <p>The contact form has the following code:</p>
  
  <pre><code>&lt;form method="post" action="" accept-charset="UTF-8" data-abide&gt;
          {{ getCsrfInput() }}
          &lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt;
          &lt;input type="hidden" name="redirect" value="thanks?from={fromName}"&gt;
  
          // Rest of code: fields, etc.
  
  &lt;/form&gt;
  </code></pre>
  
  <p>The redirect template is called <strong>thanks</strong> and it works as it should except that the thanks page is always redirecting to the EN locale.
  When I manualy navigate my browser to go to the thank you page in another locale it works too. But after submitting the form, it just does not redirect to the current locale.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Removing <code>?from{fromName}</code> does not resolve the issue</p>
  
  <p><code>siteUrl</code> is set in the config file:</p>
  
  <pre><code>'*' =&gt; array(    
  'siteUrl' =&gt; array(
                  'nl' =&gt; 'http://cmgg.buthost.com/nl/',
                  'fr' =&gt; 'http://cmgg.buthost.com/fr/',
                  'en' =&gt; 'http://cmgg.buthost.com/en/'
              )
  )
  </code></pre>
  
  <p>Sidenote: the whole website is almost final and everything with the locales is working as it should except the contact form redirect.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-17T11:24:47.443Z
Comments.Text: I'm having this issue as well - did you find a solution?
Comments.UserDisplayName: megatrond
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T03:58:56.540Z
Comments.Text: 2 years later and still no solution?! Anyone? I've come across this exact issue, sending me to the EN locale.
Comments.UserDisplayName: mateostabio
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T11:47:54.470Z
Comments.Text: Sorry, I don't know if I ever found a solution or a workaround. Just checked the project code, but didn't find anything specific and I don't have it running locally anymore to test it.
Comments.UserDisplayName: Tom De Smet
Tags: <localization><redirect><plugin-contactform>
Title: Contact Form Plugin P&T redirect issue with locales
ThreadText: # Contact Form Plugin P&T redirect issue with locales
  
  (Asked by: username_0 on 2015-06-24)
  
  I'm using the standard P&T contact form plugin. I have a website with 3 locales in a folder structure where every locale has its own folder:
  
  Public
  
  -- EN
  
  -- FR
  
  -- NL
  
  The contact form has the following code:
  
  ```
  <form method="post" action="" accept-charset="UTF-8" data-abide>
          {{ getCsrfInput() }}
          <input type="hidden" name="action" value="contactForm/sendMessage">
          <input type="hidden" name="redirect" value="thanks?from={fromName}">
  
          // Rest of code: fields, etc.
  
  </form>
  
  ```
  
  The redirect template is called **thanks** and it works as it should except that the thanks page is always redirecting to the EN locale.
  When I manualy navigate my browser to go to the thank you page in another locale it works too. But after submitting the form, it just does not redirect to the current locale.
  
  **Update**
  
  Removing `?from{fromName}` does not resolve the issue
  
  `siteUrl` is set in the config file:
  
  ```
  '*' => array(    
  'siteUrl' => array(
                  'nl' => 'http://cmgg.buthost.com/nl/',
                  'fr' => 'http://cmgg.buthost.com/fr/',
                  'en' => 'http://cmgg.buthost.com/en/'
              )
  )
  
  ```
  
  Sidenote: the whole website is almost final and everything with the locales is working as it should except the contact form redirect.
  
  **Tags:** localization, redirect, plugin-contactform
  
  > **Comments:**
  > **username_1**: I'm having this issue as well - did you find a solution?  
  > **username_2**: 2 years later and still no solution?! Anyone? I've come across this exact issue, sending me to the EN locale.  
  > **username_0**: Sorry, I don't know if I ever found a solution or a workaround. Just checked the project code, but didn't find anything specific and I don't have it running locally anymore to test it.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-08-11. Score: 1
  
  Well you could prepend the current locale to the redirect string with the craft.locale variable
  
  ```
  <input type="hidden" name="redirect" value="{{craft.locale}}/thanks?from={fromName}">
  
  ```
  
  In Craft 3 the redirect parameters need to be hashed and craft.locale is deprecated so we need to use craft.app.language. So when using the input tag you could do it like this
  
  ```
  {% set redirectParam = craft.app.language ~ '/thanks?from={fromName}' %}
  
  <input type="hidden" name="redirect" value="{{redirectParam | hash}}">
  
  ```
  
  or use the built in helper function
  
  ```
  {{ redirectInput(craft.app.language ~ '/thanks?from={fromName}') }}
  
  ```
  
  other option would be to prepend the baseUrl of the current site ( craft3 )
  
  ```
  {% set baseUrl = craft.app.sites.currentSite.baseUrl ? craft.app.sites.currentSite.baseUrl : '/' %}
  
  {{ redirectInput(baseUrl ~ '/thanks?from={fromName}') }}
  
  ```
  
  
  ---
  
  ### Answer by username_4 on 2015-06-26. Score: 1
  
  Remove 'usePathInfo' => true, from your /craft/config/general.php
  
  This fixed a similar error on my site.
  
  > **Comments:**
  > **username_0**: I don't use that setting in my config.  
  
  ---
  
  