Answers.Body: <p>Thanks to P&amp;T via a support ticket, this issue has been resolved.</p>
  
  <p>Basically I just had a structure which, some point, I had used as my navigation and was causing a conflict. Something which I just completely overlooked.</p>
  
  <p>From P&amp;T via a support ticket:</p>
  
  <blockquote>
    <p>The issue seems to be in your Navigation structure. You have "Entries in this section have their own URLs" turned on, but you do not set a template for the section. So, when a user requests 'search', which is an entry in your Navigation structure, Craft defaults to show the index.twig template.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-25T20:17:05.333Z
Answers.LastActivityDate: 2015-09-25T20:17:05.333Z
Answers.UserDisplayName: Alec Ritson
Body: <p>I have an issue regarding two (that I’ve come across) routes just simply loading the index template when they shouldn’t.</p>
  
  <p>My template structure looked like this:</p>
  
  <pre><code>- search
   - index.twig
  - index.twig
  </code></pre>
  
  <p>When I visited <code>/search</code> the root <code>/index.twig</code> template (front page) loads up.</p>
  
  <p>If I create <code>search.twig</code> next to <code>/index.twig</code> and again go to <code>/search</code> I still get the home template rendered. Removing all <code>search</code> templates and going to <code>/search</code> again, still renders the <code>index.twig</code> template.</p>
  
  <p>There is nothing in <code>config/routes.php</code> and there are also no routes present in <code>craft_routes</code> within the database.</p>
  
  <p>I may have had these routes set up at some point in the past (the project is a bit old), so I created a new database and installed Craft again (kept all other template files, replaced <code>craft/app</code> folder) and the problem went away. Switched database in config (kept new <code>craft/app</code> folder) and now the problem is back again.</p>
  
  <p>Is there anything in the database somewhere that would cause old routes to persist or be funky when the templates and any <code>config/routes.php</code> have been deleted?</p>
  
  <p>I did try and look through the tables but couldn’t really spot anything that stood out, any help would be awesome!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-24T15:02:13.387Z
Comments.Text: I just tried the same setup on my local machine and didn't have any problem loading the correct templates. Do you have any sections called 'search' that may be conflicting?
Comments.UserDisplayName: Aaron Berkowitz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-24T18:09:33.673Z
Comments.Text: Maybe some weird APC/Opcache/Varnish caching going on?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-24T18:17:19.830Z
Comments.Text: @AaronBerkowitz its strange there don't seem to be any conflicting sections, it feels like its at a database level because its resolved as soon as I switch to a new database in `config/db.php` ...
  
  @BradBell I'm running on MAMP Pro and caching is turned off :/
  
  I also manually emptied out `storage/runtime\compiled_templates` and cleared the cache. No plugins are installed either
Comments.UserDisplayName: Alec Ritson
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-24T22:14:41.773Z
Comments.Text: @AlecRitson If you would like, bundle up your templates and a database export and send to support@pixelandtonic.com so we take a closer look!
Comments.UserDisplayName: Aaron Berkowitz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-25T12:50:07.530Z
Comments.Text: Hey @AaronBerkowitz I've sent a request through the control panel, I will update this question with any progress. Thanks for you time!
Comments.UserDisplayName: Alec Ritson
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-25T18:50:08.950Z
Comments.Text: @AlecRitson Looks like you're all sorted in the ticket.  Want to add an official answer?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-25T20:18:01.130Z
Comments.Text: @BradBell Yes! Sorry for the delay and thanks for all your help!
Comments.UserDisplayName: Alec Ritson
Tags: <templating>
Title: Phantom routes load index template, no 404 and no errors
ThreadText: # Phantom routes load index template, no 404 and no errors
  
  (Asked by: username_0 on 2015-09-24)
  
  I have an issue regarding two (that I’ve come across) routes just simply loading the index template when they shouldn’t.
  
  My template structure looked like this:
  
  ```
  - search
   - index.twig
  - index.twig
  
  ```
  
  When I visited `/search` the root `/index.twig` template (front page) loads up.
  
  If I create `search.twig` next to `/index.twig` and again go to `/search` I still get the home template rendered. Removing all `search` templates and going to `/search` again, still renders the `index.twig` template.
  
  There is nothing in `config/routes.php` and there are also no routes present in `craft_routes` within the database.
  
  I may have had these routes set up at some point in the past (the project is a bit old), so I created a new database and installed Craft again (kept all other template files, replaced `craft/app` folder) and the problem went away. Switched database in config (kept new `craft/app` folder) and now the problem is back again.
  
  Is there anything in the database somewhere that would cause old routes to persist or be funky when the templates and any `config/routes.php` have been deleted?
  
  I did try and look through the tables but couldn’t really spot anything that stood out, any help would be awesome!
  
  **Tags:** templating
  
  > **Comments:**
  > **username_1**: I just tried the same setup on my local machine and didn't have any problem loading the correct templates. Do you have any sections called 'search' that may be conflicting?  
  > **username_2**: Maybe some weird APC/Opcache/Varnish caching going on?  
  > **username_0**: @username_1 its strange there don't seem to be any conflicting sections, it feels like its at a database level because its resolved as soon as I switch to a new database in `config/db.php` ...  @username_2 I'm running on MAMP Pro and caching is turned off :/  I also manually emptied out `storage/runtime\compiled_templates` and cleared the cache. No plugins are installed either  
  > **username_1**: @username_0 If you would like, bundle up your templates and a database export and send to support@pixelandtonic.com so we take a closer look!  
  > **username_0**: Hey @username_1 I've sent a request through the control panel, I will update this question with any progress. Thanks for you time!  
  > **username_2**: @username_0 Looks like you're all sorted in the ticket.  Want to add an official answer?  
  > **username_0**: @username_2 Yes! Sorry for the delay and thanks for all your help!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-09-25. Score: 1 | Accepted answer
  
  Thanks to P&T via a support ticket, this issue has been resolved.
  
  Basically I just had a structure which, some point, I had used as my navigation and was causing a conflict. Something which I just completely overlooked.
  
  From P&T via a support ticket:
  
  > The issue seems to be in your Navigation structure. You have "Entries in this section have their own URLs" turned on, but you do not set a template for the section. So, when a user requests 'search', which is an entry in your Navigation structure, Craft defaults to show the index.twig template.
  
  
  ---
  
  