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

CC BY-SA 3.0
2015-04-23T10:46:33.077Z
2015-04-23T20:08:23.917Z
2015-04-23T20:08:23.917Z
magicspon
<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>

CC BY-SA 3.0
2015-08-06T01:02:38.143Z
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.
rdomingue
<search>
Search form returning all pages
# 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
      
        
          
            Search
            
            
          
        
      

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') %}

    Search Results
    {% if entries|length %}
        {{ entries|length }} results:
    {% else %}
        Your search for “{{ query }}” didn’t return any results.
    {% endif %}


    {% if entries|length %}
        {% for entry in entries %}
            {{ entry.title }}
        {% 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]


---

