title: Relative path in HTML
body: <p>I am creating a website on <code>localhost</code>. I want to make all of link resources in my website to relative path ( I mean only internal resources).</p>
  
  <p>website is located in </p>
  
  <pre><code>http://localhost/mywebsite
  </code></pre>
  
  <p>I read this useful question <a href="https://stackoverflow.com/questions/2005079/absolute-vs-relative-urls">Absolute vs relative URLs</a>.</p>
  
  <p>I found differences between <code>/images/example.png</code> and <code>images/example.png</code></p>
  
  <p><code>&lt;a href="/images/example.png"&gt; Link To Image&lt;/a&gt;</code></p>
  
  <p>Above relative path should return <code>ROOT_DOCUMENT/images/example.png</code> because of <code>/</code> at first of url. As <code>ROOT_DOCUMENT</code> is something like <code>/wamp/www/mywebsite</code></p>
  
  <p>But when I tested it, it only return <code>/wamp/www/images/example.png</code></p>
  
  <p>And I should add manually my website folder <code>/mywebsite/images/example.png</code> to relative path.</p>
  
  <pre><code>&lt;a href="mywebsite/images/example.png"&gt; Link To Image&lt;/a&gt;
  </code></pre>
  
  <p>And it is not useful because of changing the name of mywebsite. So:</p>
  
  <ul>
  <li>Why does this problem occur?</li>
  <li>How can I resolve this problem?</li>
  </ul>