Answers.Body: <p>Templates starting with an underscore character is by default denied direct access in Craft (resulting in a 404 not found error). I guess that renaming your template to "results" should fix it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T12:06:59.443Z
Answers.Text: that was it! Thanks. Strange enough, my 404 template is not showing up at all...
Answers.UserDisplayName: jjem
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T12:42:30.923Z
Answers.Text: Check that you don't have any rewrite rules in your .htaccess concerning 404 handling. If there is a redirect in there, the request doesn't reach Craft at all.
Answers.UserDisplayName: André Elvan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-22T12:02:19.793Z
Answers.LastActivityDate: 2014-09-22T12:02:19.793Z
Answers.UserDisplayName: André Elvan
Body: <p>I am trying to set up a search form in my website. Followed <a href="http://buildwithcraft.com/docs/templating/search-form" rel="nofollow">this tutorial</a> on builtwithcraft documentation website.</p>
  
  <p>So in my top navigation bar I include this code</p>
  
  <pre><code>&lt;form class="navbar-form navbar-right" role="search" action="{{ url('/oeuvres/_results') }}"&gt;
      &lt;div class="input-group"&gt;
          &lt;input type="search" class="form-control" name="q" placeholder="Recherche"&gt;
          &lt;span class="input-group-btn"&gt;
              &lt;button type="button" class="btn btn-default" value="Go"&gt;&lt;span class="glyphicon glyphicon-search"&gt; &lt;/span&gt;&lt;/button&gt;
          &lt;/span&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And then the result page:</p>
  
  <pre><code>{% extends "_layout" %}
  
  {% block main %}
      {% include "includes/_topNav" %}
  
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;h1&gt;Résultats&lt;/h1&gt;
  
                  {% set query = craft.request.getParam('q') %}
                  {% set entries = craft.entries.search(query).section('oeuvres') %}
  
                  {% if entries|length %}
                      &lt;p&gt;{{ entries|length }} Votre recherche:&lt;/p&gt;
                      &lt;ul&gt;
                          {% for entry in entries %}
                              &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
                          {% endfor %}
                      &lt;/ul&gt;
                  {% else %}
                      &lt;p&gt;Votre recherche “{{ query }}” n'a donné aucun résultat.&lt;/p&gt;
                  {% endif %}
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      {% include "includes/_javaScript" %}
  {% endblock %}
  </code></pre>
  
  <p>I have no idea what is wrong, it seems that the "q" param is passing through the result page (the address line is for example: <a href="http://www.example.com/oeuvres/_results?q=routes" rel="nofollow">http://www.example.com/oeuvres/_results?q=routes</a>
  But the page is totally blank. Meaning nothing gets generated between the body tags. (not even the template tags...</p>
  
  <p>I can't find what I am missing here.</p>
  
Tags: <search>
Title: Search form generates blank page
ThreadText: # Search form generates blank page
  
  (Asked by: username_0 on 2014-09-22)
  
  I am trying to set up a search form in my website. Followed [this tutorial](http://buildwithcraft.com/docs/templating/search-form) on builtwithcraft documentation website.
  
  So in my top navigation bar I include this code
  
  ```
  <form class="navbar-form navbar-right" role="search" action="{{ url('/oeuvres/_results') }}">
      <div class="input-group">
          <input type="search" class="form-control" name="q" placeholder="Recherche">
          <span class="input-group-btn">
              <button type="button" class="btn btn-default" value="Go"><span class="glyphicon glyphicon-search"> </span></button>
          </span>
      </div>
  </form>
  
  ```
  
  And then the result page:
  
  ```
  {% extends "_layout" %}
  
  {% block main %}
      {% include "includes/_topNav" %}
  
      <div class="container">
          <div class="row">
              <div class="col-md-12">
                  <h1>Résultats</h1>
  
                  {% set query = craft.request.getParam('q') %}
                  {% set entries = craft.entries.search(query).section('oeuvres') %}
  
                  {% if entries|length %}
                      <p>{{ entries|length }} Votre recherche:</p>
                      <ul>
                          {% for entry in entries %}
                              <li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
                          {% endfor %}
                      </ul>
                  {% else %}
                      <p>Votre recherche “{{ query }}” n'a donné aucun résultat.</p>
                  {% endif %}
              </div>
          </div>
      </div>
  
      {% include "includes/_javaScript" %}
  {% endblock %}
  
  ```
  
  I have no idea what is wrong, it seems that the "q" param is passing through the result page (the address line is for example: <http://www.example.com/oeuvres/_results?q=routes>
  But the page is totally blank. Meaning nothing gets generated between the body tags. (not even the template tags...
  
  I can't find what I am missing here.
  
  **Tags:** search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-09-22. Score: 1 | Accepted answer
  
  Templates starting with an underscore character is by default denied direct access in Craft (resulting in a 404 not found error). I guess that renaming your template to "results" should fix it.
  
  > **Comments:**
  > **username_0**: that was it! Thanks. Strange enough, my 404 template is not showing up at all...  
  > **username_1**: Check that you don't have any rewrite rules in your .htaccess concerning 404 handling. If there is a redirect in there, the request doesn't reach Craft at all.  
  
  ---
  
  