title: How to route everything to default controller in codeigniter?
body: <p>I have a website <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> built using codeigniter 2. the default controller is <br></p>
  
  <pre><code>$route['default_controller'] = "domain";
  </code></pre>
  
  <p>If I try to access pageX, the link should be <code>http://example.com/en/domain/view/pageX</code>.<br>
  I want to allow the visitor of the website to access this page by typing<br></p>
  
  <pre><code>http://example.com/pageX
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code>$route['(:any)'] = "view/$1"; ==&gt; it gives 404 Page Not Found
  $route['(:any)'] = "domain/view/$1"; ==&gt; it redirects to homepage with link shown as http://example.com/en/pageX
  $route['(:any)'] = "en/domain/view/$1"; ==&gt; it gives 404 Page Not Found
  </code></pre>
  
  <p>but non of them worked for me.  </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>by adding this:</p>
  
  <pre><code>$route['(:any)'] = 'domain/view/$1';  
  $route['en/blog']   =  'domain/view/blog';
  </code></pre>
  
  <p><code>example.com/blog</code> will work fine
  but I need it to be more general to cover all pages except admin page, something like this:</p>
  
  <pre><code>$route['(:any)'] = 'domain/view/$1';  
  $route['^(?!admin).*']   =  'domain/view/$o';
  //The above routes will show the home page only for whatever i try!!
  </code></pre>
  
  <p>What is the route that i have to add to <code>routes.php</code>?</p>