title: Develop a sub-websites (micro websites) in Codeignitter
body: <p><br/></p>
  
  <p>Let's say I have a website called <a href="http://mysite.dev" rel="nofollow">http://mysite.dev</a>
  <br/><br/></p>
  
  <h2>What I have:</h2>
  
  <p>So the urls of some pages will be below.</p>
  
  <p>Home page: <a href="http://mysite.dev" rel="nofollow">http://mysite.dev</a> or <a href="http://mysite.dev/site/index" rel="nofollow">http://mysite.dev/site/index</a> or <a href="http://mysite.dev/home" rel="nofollow">http://mysite.dev/home</a>
  (site/index has been routed to home)</p>
  
  <p>Edit Profile: <a href="http://mysite.dev/user/edit" rel="nofollow">http://mysite.dev/user/edit</a> or <a href="http://mysite.dev/edit-profile" rel="nofollow">http://mysite.dev/edit-profile</a>
  (user/edit has been routed to edit-profile)</p>
  
  <p>Admin Dashboard: <a href="http://mysite.dev/admin/" rel="nofollow">http://mysite.dev/admin/</a> or <a href="http://mysite.dev/admin/index" rel="nofollow">http://mysite.dev/admin/index</a></p>
  
  <p>Admin View Users: <a href="http://mysite.dev/admin/users" rel="nofollow">http://mysite.dev/admin/users</a> or <a href="http://mysite.dev/admin/users/index" rel="nofollow">http://mysite.dev/admin/users/index</a></p>
  
  <p>Admin Edit User: <a href="http://mysite.dev/admin/users/edit/1" rel="nofollow">http://mysite.dev/admin/users/edit/1</a></p>
  
  <p>So, basically my url pattern is as below.</p>
  
  <p><strong><a href="http://mysite.dev/" rel="nofollow">http://mysite.dev/</a>{module}/{controller}/{action}/{params}</strong>
  <br/><br/></p>
  
  <h2>What I need:</h2>
  
  <p>While keeping the main site as above, I need to have sub websites (micro websites) which will share the same login in the main site.</p>
  
  <p>So that, the url pattern would be as below.</p>
  
  <p><strong><a href="http://mysite.dev/" rel="nofollow">http://mysite.dev/</a>{microsite}/{module}/{controller}/{action}/{params}</strong></p>
  
  <p>(microsite is empty means its the main website. There will no be any directory to represent the microsite since its just a reference as a  name.)</p>
  
  <p>That means, this microsite will not have sub directories since it the microsite name will be dynamic.
  <br/><br/></p>
  
  <h2>What I need to know:</h2>
  
  <p>How can I implement that url pattern either using .htaccess or url routing to develop this dynamic microsites.</p>
  
  <p><br/>
  Thank you!</p>