Separate CodeIgniter public folder
<p>I've been trying to change my CodeIgniter file structure to make it safer and cleaner but I can't get it to work. I want to separate the application/system and the public files that are going to be visible to users.</p>

<pre><code>- application
- system
- public
</code></pre>

<p>It works but I have to enter </p>

<blockquote>
  <p>example.com/public/index.php or example.com/public/controller</p>
</blockquote>

<p>I want to be able to just type the base URL like example.com/controller.</p>

<p>How can I do it?</p>