Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK, let's take a look at these one by one (assuming your domain is 'example.com' and you have 'index.php' hidden via '.htaccess'):</p> <pre><code>$route['photo/(:num)'] = "viewphoto/view/$1"; </code></pre> <p>This will grab any url like this: <code>http://example.com/photo/36</code> and route it to the <code>/application/controllers/viewphoto</code> controller, and call the <code>view</code> method and pass it 36 as the parameter.</p> <hr> <pre><code>$route['photo'] = 'photo'; </code></pre> <p>This will grab any url like this: <code>http://example.com/photo</code> and route it to the <code>/application/controllers/photo</code> controller, and call the <code>index</code> method with no parameter.</p> <hr> <pre><code>$route['photos'] = "photospage/index"; </code></pre> <p>This will grab any url like this: <code>http://example.com/photos</code> and route it to the <code>/application/controllers/photospage</code> controller, and call the <code>index</code> method with no parameter.</p> <hr> <pre><code>$route['photos'] = 'photos'; </code></pre> <p>This will grab any url like this: <code>http://example.com/photos</code> and route it to the <code>/application/controllers/photos</code> controller, and call the <code>index</code> method with no parameter. <strong>This route will never get called because it duplicates the one right before it</strong></p> <hr> <pre><code>$route['default_controller'] = 'homepage'; </code></pre> <p>This will grab any url that hasn't been caught thus far and route it to the <code>/application/controllers/homepage</code> controller, and call the <code>index</code> method with no parameter.</p> <hr> <pre><code>$route['homepage'] = 'homepage'; </code></pre> <p>This will grab any url like this: <code>http://example.com/homepage</code> and route it to the <code>/application/controllers/homepage</code> controller, and call the <code>index</code> method with no parameter.</p> <p>My guess is this has to do with not having an <code>index</code> method in the controllers. If that is not the case, then we would need to see the contents of the <code>.htaccess</code> file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload