<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>

CC BY-SA 4.0
2018-08-11T22:09:43.653Z
2018-08-13T03:30:44.203Z
2018-08-13T03:30:44.203Z
Sean Tilley
<p>Remove 'usePathInfo' => true, from your /craft/config/general.php</p>

<p>This fixed a similar error on my site. </p>

CC BY-SA 3.0
2015-06-27T09:40:53.123Z
I don't use that setting in my config.
Tom De Smet
CC BY-SA 3.0
2015-06-26T12:50:34.510Z
2015-06-26T12:50:34.510Z
Peter Zilka
<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>

CC BY-SA 3.0
2015-08-17T11:24:47.443Z
I'm having this issue as well - did you find a solution?
megatrond
CC BY-SA 3.0
2017-08-07T03:58:56.540Z
2 years later and still no solution?! Anyone? I've come across this exact issue, sending me to the EN locale.
mateostabio
CC BY-SA 3.0
2017-08-07T11:47:54.470Z
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.
Tom De Smet
<localization><redirect><plugin-contactform>
Contact Form Plugin P&T redirect issue with locales
# 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:

        {{ getCsrfInput() }}
        
        

        // Rest of code: fields, etc.



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 


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}' %}



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.  

---

