title: How can I load a Page using Codeigniter controller?
body: <p>I have made a kind of CMS using CodeIgniter. It loads the page content from Database depending on the <code>slug</code> text passed in the URL parameter like e.g. about, services, contact.</p>
  
  <p>In the controller code, I have remapped the index method to take the slug as parameter to it as default index methods don't allow parameters. 
  Check the code of my <code>page</code> controller on the link below :</p>
  
  <p><a href="http://pastebin.com/MwsVzRwQ" rel="nofollow">http://pastebin.com/MwsVzRwQ</a></p>
  
  <p>The way this works is, I have set <code>page</code> controller to load as default. So every time I open my site like this</p>
  
  <p><a href="http://www.mysite.com" rel="nofollow">http://www.mysite.com</a></p>
  
  <p>it loads the controller like this</p>
  
  <p><a href="http://www.mysite.com/page" rel="nofollow">http://www.mysite.com/page</a></p>
  
  <p>If we pass the slug to it, it loads the page content of that slug from database, like this</p>
  
  <p><a href="http://www.mysite.com/page/about" rel="nofollow">http://www.mysite.com/page/about</a>
  http://www.mysite.com/page/portfolio</p>
  
  <p>If we don't pass the slug, it loads the home page.</p>
  
  <p>Now what I want to do is, I don't want this 'page' text to appear in URL. So pages should open like this</p>
  
  <p><a href="http://www.mysite.com/about" rel="nofollow">http://www.mysite.com/about</a></p>
  
  <p><a href="http://www.mysite.com/portfolio" rel="nofollow">http://www.mysite.com/portfolio</a></p>
  
  <p>I guess this will be possible through URL rewriting. 
  I have already done URL rewriting for removing <code>index.php</code> from URL which is normally done for all Codeigniter websites. Below is the code of my .htaccess file</p>
  
  <pre><code>RewriteEngine on
  
  RewriteCond $1 !^(index\.php|uploads|fckeditor|assets|robots\.txt)
  
  RewriteRule ^(.*)$ /jobsite/index.php/$1 [L]
  </code></pre>
  
  <p>Now the question is, how can I make the URL work like this</p>
  
  <p><a href="http://www.mysite.com/about" rel="nofollow">http://www.mysite.com/about</a></p>
  
  <p><a href="http://www.mysite.com/portfolio" rel="nofollow">http://www.mysite.com/portfolio</a></p>
  
  <p>Thanks in Advance.</p>