Body: <p>If I have a rich text field containing a link to an asset and I create the link on my development server <code>sample.craft.dev</code>, the html in the rich text field contains this:</p>
  
  <pre><code>&lt;a href="http://sample.craft.dev/uploads/pdfs/file.pdf#asset:945:url"&gt;the file&lt;/a&gt;
  </code></pre>
  
  <p>If I then move the database to my staging server <code>stage.sample.com</code>, the html in the rich text field now magically contains the new url:</p>
  
  <pre><code>&lt;a href="http://stage.sample.com/uploads/pdfs/file.pdf#asset:945:url"&gt;the file&lt;/a&gt;
  </code></pre>
  
  <p>How does that happen?</p>
  
  <p>If the html in the rich text field on the development server instead contains this:</p>
  
  <pre><code>&lt;select class="jumpMenu js_jumpMenu"&gt;
    &lt;option value=""&gt;-- select brochure --&lt;/option&gt;
    &lt;option value="http://stage.sample.com/uploads/pdfs/file.pdf#asset:969:url"&gt;The File&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Then the url is not rewritten. Why is that?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-21T18:15:50.453Z
Comments.Text: I assume you're manually entering the `#asset:969:url` in the 2nd example?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-21T19:37:08.910Z
Comments.Text: Yes, entering it manually.
Comments.UserDisplayName: Marion Newlevant
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-21T22:19:00.857Z
Comments.Text: Not an answer, but take a look at RichTextInput.js. There is some magic going on in there specifically when linking to an asset or inserting an image.
Comments.UserDisplayName: Brad Bell
Tags: <richtext><multi-environment>
Title: How do asset and entry urls in rich text fields change with the environment?
ThreadText: # How do asset and entry urls in rich text fields change with the environment?
  
  (Asked by: username_0 on 2014-12-21)
  
  If I have a rich text field containing a link to an asset and I create the link on my development server `sample.craft.dev`, the html in the rich text field contains this:
  
  ```
  <a href="http://sample.craft.dev/uploads/pdfs/file.pdf#asset:945:url">the file</a>
  
  ```
  
  If I then move the database to my staging server `stage.sample.com`, the html in the rich text field now magically contains the new url:
  
  ```
  <a href="http://stage.sample.com/uploads/pdfs/file.pdf#asset:945:url">the file</a>
  
  ```
  
  How does that happen?
  
  If the html in the rich text field on the development server instead contains this:
  
  ```
  <select class="jumpMenu js_jumpMenu">
    <option value="">-- select brochure --</option>
    <option value="http://stage.sample.com/uploads/pdfs/file.pdf#asset:969:url">The File</option>
  </select>
  
  ```
  
  Then the url is not rewritten. Why is that?
  
  **Tags:** richtext, multi-environment
  
  > **Comments:**
  > **username_1**: I assume you're manually entering the `#asset:969:url` in the 2nd example?  
  > **username_0**: Yes, entering it manually.  
  > **username_1**: Not an answer, but take a look at RichTextInput.js. There is some magic going on in there specifically when linking to an asset or inserting an image.  
  
  ---
  
  ## 0 answers
  
  