title: PHP mvc routing issue with links
body: <p>I'm just beginning with PHP, and started with YouTube tutorial about  <a href="https://www.youtube.com/playlist?list=PLfdtiltiRHWGXVHXX09fxXDi-DqInchFD" rel="nofollow">mvc</a>.
  All went well, but when I started to develop my own application I encountered a problem with routing (I think).</p>
  
  <p>My base application has URL: localhost/mvc/public/. </p>
  
  <p>With the tutorial I created a class which starts a default home controller and index action when those are not specified. So localhost/mvc/public/ is equivalent to localhost/mvc/public/home/index.</p>
  
  <p>In my view I have:</p>
  
  <pre><code>&lt;p&gt;You need to &lt;a href="profile/login"&gt;log in&lt;/a&gt; or &lt;a href="profile/register"&gt;register&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>So when I start with url localhost/mvc/public/ and then click on a link, it goes to localhost/mvc/public/profile/login and everything works fine.
  But if I write url localhost/mvc/public/home/index and then click a link I go to localhost/mvc/public/home/profile/index which obviously doesn't work.
  So my question is - how to solve this problem?</p>
  
  <p>If someone is interested, I can post my code.</p>