title: Relative URLs in WordPress
body: <p>I've always found it frustrating in WordPress that images, files, links, etc. are inserted into WordPress with an absolute URL instead of relative URL. A relative url is much more convenient for switching domain names, changing between http and https etc. Today I discovered that if you define WP_CONTENT_URL with a relative url then when you insert files into posts they use the relative url for the src instead of absolute url. Just what I've always wanted! But the official WordPress documentation says that you should use a <em>full URI</em> if you are defining WP_CONTENT_URL.</p>
  
  <p><a href="http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder" rel="noreferrer">WordPress codex says</a>:</p>
  
  <blockquote>
    <p>Set WP_CONTENT_URL to the <strong>full URI</strong> of this directory (no trailing
    slash), e.g.</p>
  
  <pre><code>define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');
  </code></pre>
  </blockquote>
  
  <p>Everything seems to work fine when I use a relative URL, e.g.</p>
  
  <pre><code>define( 'WP_CONTENT_URL', '/my-content-folder');
  </code></pre>
  
  <p>But is there some problem with using a relative URI? I'm just thinking that there must be a reason for WordPress stating that it should be defined with a full URI. </p>