<p>If your entry's slug is <code>en/contact</code> and you need it to show up when you go to the URL <code>domain.com/en/contact/en/contact</code>, the Section settings for the <strong>Entry URL Format</strong> should be <code>en/contact/{slug}</code>:</p>

<p><a href="https://i.sstatic.net/Us4vv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Us4vv.png" alt="enter image description here"></a></p>

<p>Also, you shouldn't need to use the language code prefix (<code>en/</code>) in Section settings. That should be defined in your <code>config/general.php</code> file. See the <a href="https://docs.craftcms.com/v2/localization-guide.html#step-4-define-your-site-urls" rel="nofollow noreferrer">Define your site URLs</a> section of the Craft 2 docs on localization.</p>

<pre><code>return array(
    // ...
    'siteUrl' =&gt; array(
        'en' =&gt; 'http://example.com/en/',
        'no' =&gt; 'http://example.com/no/',
    ),
);
</code></pre>

<p>Then, if you Section's URL settings are <code>contact/{slug}</code>, these URLs will both work:</p>

<pre><code>http://example.com/en/contact/en/contact
http://example.com/no/contact/en/contact
</code></pre>

CC BY-SA 4.0
2018-09-14T08:57:39.240Z
2018-09-14T08:57:39.240Z
Alex Roper
<p>I have taken over a project and Im having a small problem with locales.</p>

<p>It is running Craft 2.6.3016</p>

<p>A section has a locale “en” where the english URL format is “en/contact”, and the entry also have the slug “en/contact”…
So, I would expect this URL to be domain.com/en/contact/en/contact, no? But it is not!</p>

<p><a href="https://i.sstatic.net/oEC52.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oEC52.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/qy8Nq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qy8Nq.png" alt="enter image description here"></a></p>

<p>When getting the URL with this code:</p>

<pre><code>{{ craft.entries.section( 'contact' ).first().url }}
</code></pre>

<p>the url is “domain.com/en/en/contact”, this link does not work, but if I change it to “domain.com/en/contact” as I would expect it to be, it works!!</p>

<p>I have no idea what kind of dark magic that messes around with this, but maybe some of you got any ideas? Nothing seems to make any sense here.
Also note that the “en” folder in the public folder is called “en__” if I change this to “en” the locale stops working.</p>

<p>Any help appreciated!</p>

<localization><url><craft2>
Locales and links not working as intended
# Locales and links not working as intended

(Asked by: username_0 on 2018-09-12)

I have taken over a project and Im having a small problem with locales.
It is running Craft 2.6.3016
A section has a locale “en” where the english URL format is “en/contact”, and the entry also have the slug “en/contact”…
So, I would expect this URL to be domain.com/en/contact/en/contact, no? But it is not!


When getting the URL with this code:
{{ craft.entries.section( 'contact' ).first().url }}

the url is “domain.com/en/en/contact”, this link does not work, but if I change it to “domain.com/en/contact” as I would expect it to be, it works!!
I have no idea what kind of dark magic that messes around with this, but maybe some of you got any ideas? Nothing seems to make any sense here.
Also note that the “en” folder in the public folder is called “en__” if I change this to “en” the locale stops working.
Any help appreciated!

**Tags:** localization, url, craft2

---

## 1 answers

### Answer by username_1 on 2018-09-14. Score: 1

If your entry's slug is en/contact and you need it to show up when you go to the URL domain.com/en/contact/en/contact, the Section settings for the Entry URL Format should be en/contact/{slug}:

Also, you shouldn't need to use the language code prefix (en/) in Section settings. That should be defined in your config/general.php file. See the Define your site URLs section of the Craft 2 docs on localization.
return array(
    // ...
    'siteUrl' => array(
        'en' => 'http://example.com/en/',
        'no' => 'http://example.com/no/',
    ),
);

Then, if you Section's URL settings are contact/{slug}, these URLs will both work:
http://example.com/en/contact/en/contact
http://example.com/no/contact/en/contact


---

