title: How to use absolute URLs while saving image sources in Database from CKEDITOR
body: <p>I am using CKEDITOR for creating newsletters. Everything went fine but when I send newsletters to email, the images stored there aren't displayed. The problem was caused by CKEDITOR using relative path for image sources, e.g. <code>&lt;img src='/newsletter_images/news1/img1.jpg'&gt;</code>.</p>
  
  <p>I want CKEDITOR to use absolute urls such as:</p>
  
  <pre><code>&lt;img src='http://www.mydomain.com/newsletter_images/news1/img1.jpg' /&gt;
  </code></pre>
  
  <p>The initialization I tried is as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#editor1').ckeditor({ baseHref: "http://www.google.com/" });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>but didn't work.</p>
  
  <p>On some posts I found using <code>baseUrl</code> and <code>baseDir</code> could solve the issue. I tried this:</p>
  
  <pre><code> $('#editor1').ckeditor({
                     baseHref: "http://www.mydomain.com/",
                     baseUrl: "http://www.mydomain.com/newsletter/",
                     baseDir: "/newsletter/"
   });
  </code></pre>
  
  <p>but that didn't work either.</p>