Answers.Body: <p>Sorted.</p>
  
  <p>It was a .htaccess issue</p>
  
  <p>One of my redirects had a typo in it</p>
  
  <pre><code>RewriteRule ^old-page$ /new-page [R=301,L#]
  </code></pre>
  
  <p>should be </p>
  
  <pre><code>RewriteRule ^old-page$ /new-page [R=301,L]
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T10:46:33.077Z
Answers.LastActivityDate: 2015-04-23T20:08:23.917Z
Answers.LastEditDate: 2015-04-23T20:08:23.917Z
Answers.UserDisplayName: magicspon
Body: <p>My search form is returning all of the sites pages, regardless of the search term used.</p>
  
  <p>Even if I search for a load of random letters (dfbdsufbsf) all pages are returned.</p>
  
  <p>This is my search form code.  I've tried changing the button to and  but no joy</p>
  
  <pre><code>      &lt;form class='form form--search' role='search' action="{{ url('search/results') }}"&gt;
          &lt;fieldset&gt;
            &lt;div class='input'&gt;
              &lt;label class='hidden' for='q'&gt;Search&lt;/label&gt;
              &lt;input class='form__input form__input--search' placeholder="Search" name='q' id="q" tabindex='1' type='search'&gt;
              &lt;button class='form--search__button' type="submit"&gt;&lt;/button&gt;
            &lt;/div&gt;
          &lt;/fieldset&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>And here is my search results page (search/results.html) (markup removed)</p>
  
  <pre><code>{#
   # Search template
   # ---------------
  #}
  
  {% extends "_layout" %}
  {% block content %}
    {% set query = craft.request.getParam('q') %}
    {% set entries = craft.entries.search(query).order('score') %}
  
      &lt;h1 class='hero__title hero__title--news'&gt;Search Results&lt;/h1&gt;
      {% if entries|length %}
          &lt;p&gt;{{ entries|length }} results:&lt;/p&gt;
      {% else %}
          &lt;p&gt;Your search for “{{ query }}” didn’t return any results.&lt;/p&gt;
      {% endif %}
  
  
      {% if entries|length %}
          {% for entry in entries %}
              &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
          {% endfor %}
      {% endif %}
  
  {% endblock %}
  </code></pre>
  
  <p>Any ideas why this is happening.  I'm using the latest version of Craft.  This is happening locally and on production.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-06T01:02:38.143Z
Comments.Text: I have the same problem but I don't have anything in my htaccess.
  Is it normal that when I'm searching for 'test' and click on the search button it returns me all pages and the URL is : index.php?Q=test.
Comments.UserDisplayName: rdomingue
Tags: <search>
Title: Search form returning all pages
ThreadText: # Search form returning all pages
  
  (Asked by: username_0 on 2015-04-23)
  
  My search form is returning all of the sites pages, regardless of the search term used.
  
  Even if I search for a load of random letters (dfbdsufbsf) all pages are returned.
  
  This is my search form code. I've tried changing the button to and but no joy
  
  ```
        <form class='form form--search' role='search' action="{{ url('search/results') }}">
          <fieldset>
            <div class='input'>
              <label class='hidden' for='q'>Search</label>
              <input class='form__input form__input--search' placeholder="Search" name='q' id="q" tabindex='1' type='search'>
              <button class='form--search__button' type="submit"></button>
            </div>
          </fieldset>
        </form>
  
  ```
  
  And here is my search results page (search/results.html) (markup removed)
  
  ```
  {#
   # Search template
   # ---------------
  #}
  
  {% extends "_layout" %}
  {% block content %}
    {% set query = craft.request.getParam('q') %}
    {% set entries = craft.entries.search(query).order('score') %}
  
      <h1 class='hero__title hero__title--news'>Search Results</h1>
      {% if entries|length %}
          <p>{{ entries|length }} results:</p>
      {% else %}
          <p>Your search for “{{ query }}” didn’t return any results.</p>
      {% endif %}
  
      {% if entries|length %}
          {% for entry in entries %}
              <a href="{{ entry.url }}">{{ entry.title }}</a>
          {% endfor %}
      {% endif %}
  
  {% endblock %}
  
  ```
  
  Any ideas why this is happening. I'm using the latest version of Craft. This is happening locally and on production.
  
  **Tags:** search
  
  > **Comments:**
  > **username_1**: I have the same problem but I don't have anything in my htaccess. Is it normal that when I'm searching for 'test' and click on the search button it returns me all pages and the URL is : index.php?Q=test.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-04-23. Score: 2
  
  Sorted.
  
  It was a .htaccess issue
  
  One of my redirects had a typo in it
  
  ```
  RewriteRule ^old-page$ /new-page [R=301,L#]
  
  ```
  
  should be
  
  ```
  RewriteRule ^old-page$ /new-page [R=301,L]
  
  ```
  
  
  ---
  
  