Phantom routes load index template, no 404 and no errors 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!
Thanks to P&amp;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&amp;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.