<p>I have a multi language site with /nl and /en in my url.</p>

<ul>
<li>mysite.dev/nl</li>
<li>mysite.dev/en</li>
</ul>

<p>This is my configuration on general.php</p>

<pre><code>'mysite.dev' =&gt; array(
    'devMode' =&gt; true,
    'translationDebugOutput' =&gt; false,
    'siteUrl' =&gt; array(
        'nl' =&gt; '//mysite.dev/nl/',
        'en' =&gt; '//mysite.dev/en/',
    ),
    'environmentVariables' =&gt; array(
        'siteUrl'        =&gt; 'http://mysite.dev/',
        'basePath' =&gt; '/Users/lisavandaele/documents/mysite/public/',
        'baseUrl'    =&gt; 'http://mysite.dev/'),

),
</code></pre>

<p>In my asset transform settings I made: thumb (width 120, height 90, crop)</p>

<p>In my twig I use:</p>

<pre><code>{% set asset = entry.afbeelding.first() %}
            {% if asset %}
                &lt;img src="{{ asset.getUrl('thumb') }}" width="{{ asset.getWidth('thumb') }}" height="{{ asset.getHeight('thumb') }}" alt="{{entry.title}}" /&gt;&lt;br /&gt;
             {% endif %}
</code></pre>

<p>The url he uses is: //mysite.dev/nl/cpresources/transforms/1?x=UeS4gtVAw</p>

<p>if I go to the url without the /nl, I can view the image and I see he is rendered in my assets. ==> //mysite.dev/cpresources/transforms/1?x=UeS4gtVAw</p>

<p>But how can I use the correct url without the language parameter (/nl or /en) so my image transforms and can be viewed on my site.</p>

<p>I tried lots of configs, what am I overlooking? 
I also cleared my cache and images evertime I changed my configuration but nothing worked...</p>

CC BY-SA 3.0
2015-01-12T10:47:25.797Z
You defined the variable 'siteUrl' twice in your code. Once as a 'environmentVariables'. maybe craft doesn't like that?
KSPR
CC BY-SA 3.0
2015-01-12T11:42:31.097Z
good point, but that didn't fix it. But after looking at it again. I changed the URL in my settings for my image to {baseURl}img/news/ and that did it!
Lisa Van Daele
CC BY-SA 3.0
2015-01-12T12:01:43.160Z
Then I guess your image url doesn't work because your standard language has a language segment as well. Normaly the standard language would be just this `'nl' => '//mysite.dev/',`
KSPR
CC BY-SA 3.0
2015-01-12T13:04:52.453Z
it is both, / == nl and /nl == nl. it is solved with the {basaeUrl} in my settings for the image url
Lisa Van Daele
CC BY-SA 3.0
2015-01-14T17:30:50.467Z
@Lisa. You might want to add this as an answer.
Douglas McDonald
CC BY-SA 3.0
2015-04-17T13:14:56.953Z
I have exactly the same issue. But adding a {baseUrl} to the resource didn’t help. It actually doesn’t matter what I enter there. It just takes the global siteUrl and prepends it the the transform path like this: `http://domain/en/resources/transforms/...` The correct path would be without the `/en/` bit. Any ideas?
medoingthings
<multi-environment><image-transforms>
Image transform in a multi language site gives wrong getUrl()
# Image transform in a multi language site gives wrong getUrl()

(Asked by: username_0 on 2015-01-12)

I have a multi language site with /nl and /en in my url.

mysite.dev/nl
mysite.dev/en

This is my configuration on general.php
'mysite.dev' => array(
    'devMode' => true,
    'translationDebugOutput' => false,
    'siteUrl' => array(
        'nl' => '//mysite.dev/nl/',
        'en' => '//mysite.dev/en/',
    ),
    'environmentVariables' => array(
        'siteUrl'        => 'http://mysite.dev/',
        'basePath' => '/Users/lisavandaele/documents/mysite/public/',
        'baseUrl'    => 'http://mysite.dev/'),

),

In my asset transform settings I made: thumb (width 120, height 90, crop)
In my twig I use:
{% set asset = entry.afbeelding.first() %}
            {% if asset %}
                
             {% endif %}

The url he uses is: //mysite.dev/nl/cpresources/transforms/1?x=UeS4gtVAw
if I go to the url without the /nl, I can view the image and I see he is rendered in my assets. ==> //mysite.dev/cpresources/transforms/1?x=UeS4gtVAw
But how can I use the correct url without the language parameter (/nl or /en) so my image transforms and can be viewed on my site.
I tried lots of configs, what am I overlooking? 
I also cleared my cache and images evertime I changed my configuration but nothing worked...

**Tags:** multi-environment, image-transforms

> **Comments:**
> **username_1**: You defined the variable 'siteUrl' twice in your code. Once as a 'environmentVariables'. maybe craft doesn't like that?  
> **username_0**: good point, but that didn't fix it. But after looking at it again. I changed the URL in my settings for my image to {baseURl}img/news/ and that did it!  
> **username_1**: Then I guess your image url doesn't work because your standard language has a language segment as well. Normaly the standard language would be just this `'nl' => '//mysite.dev/',`  
> **username_0**: it is both, / == nl and /nl == nl. it is solved with the {basaeUrl} in my settings for the image url  
> **username_2**: @Lisa. You might want to add this as an answer.  
> **username_3**: I have exactly the same issue. But adding a {baseUrl} to the resource didn’t help. It actually doesn’t matter what I enter there. It just takes the global siteUrl and prepends it the the transform path like this: `http://domain/en/resources/transforms/...` The correct path would be without the `/en/` bit. Any ideas?  

---

## 0 answers

