Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-12T10:47:25.797Z
Comments.Text: You defined the variable 'siteUrl' twice in your code. Once as a 'environmentVariables'. maybe craft doesn't like that?
Comments.UserDisplayName: KSPR
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-12T11:42:31.097Z
Comments.Text: 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!
Comments.UserDisplayName: Lisa Van Daele
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-12T12:01:43.160Z
Comments.Text: 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/',`
Comments.UserDisplayName: KSPR
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-12T13:04:52.453Z
Comments.Text: it is both, / == nl and /nl == nl. it is solved with the {basaeUrl} in my settings for the image url
Comments.UserDisplayName: Lisa Van Daele
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-14T17:30:50.467Z
Comments.Text: @Lisa. You might want to add this as an answer.
Comments.UserDisplayName: Douglas McDonald
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-17T13:14:56.953Z
Comments.Text: 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?
Comments.UserDisplayName: medoingthings
Tags: <multi-environment><image-transforms>
Title: Image transform in a multi language site gives wrong getUrl()
ThreadText: # 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/username_0/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 %}
                  <img src="{{ asset.getUrl('thumb') }}" width="{{ asset.getWidth('thumb') }}" height="{{ asset.getHeight('thumb') }}" alt="{{entry.title}}" /><br />
               {% 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**: @username_0. 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
  
  