<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>

CC BY-SA 3.0
2015-09-25T20:17:05.333Z
2015-09-25T20:17:05.333Z
Alec Ritson
<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>

CC BY-SA 3.0
2015-09-24T15:02:13.387Z
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?
Aaron Berkowitz
CC BY-SA 3.0
2015-09-24T18:09:33.673Z
Maybe some weird APC/Opcache/Varnish caching going on?
Brad Bell
CC BY-SA 3.0
2015-09-24T18:17:19.830Z
@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
Alec Ritson
CC BY-SA 3.0
2015-09-24T22:14:41.773Z
@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!
Aaron Berkowitz
CC BY-SA 3.0
2015-09-25T12:50:07.530Z
Hey @AaronBerkowitz I've sent a request through the control panel, I will update this question with any progress. Thanks for you time!
Alec Ritson
CC BY-SA 3.0
2015-09-25T18:50:08.950Z
@AlecRitson Looks like you're all sorted in the ticket.  Want to add an official answer?
Brad Bell
CC BY-SA 3.0
2015-09-25T20:18:01.130Z
@BradBell Yes! Sorry for the delay and thanks for all your help!
Alec Ritson
<templating>
Phantom routes load index template, no 404 and no errors
# 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**: @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  
> **username_1**: @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!  
> **username_0**: Hey @AaronBerkowitz I've sent a request through the control panel, I will update this question with any progress. Thanks for you time!  
> **username_2**: @AlecRitson Looks like you're all sorted in the ticket.  Want to add an official answer?  
> **username_0**: @BradBell 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.


---

