<p>I have search working on my local .dev site.   It does not work on my live hosted site.  There are no error messages; it just reloads the home page.  </p>

<p>Here is the search code in my site template.  The results code is below...</p>

<pre><code>&lt;li class="menu-item-search"&gt;
    &lt;a href="search.html"&gt;&lt;i class="fa fa-search"&gt;&lt;/i&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt;&lt;/a&gt;
    &lt;form method="get" id="site-searchform" class="searchform" action="{{ url('search/results')}}"&gt;
        &lt;input type="search" name="q" autocomplete="off" placeholder="Search&amp;hellip;"&gt;
        &lt;input type="submit" value="Go"&gt;
    &lt;/form&gt;
&lt;/li&gt;
</code></pre>

<p>The results page...</p>

<pre><code>&lt;main id="content" class="cointainer container-masonry" role="main"&gt; 
    &lt;div id="grid-fix" class="container"&gt;

        {% if entries|length %}     
            {% for post in entries %}
                &lt;div class="box col-sm-3"&gt;
                    &lt;div class="post-box vertical clearfix"&gt;

                        &lt;div class="extra-info"&gt;                
                            &lt;h5&gt;&lt;a href="{{ post.url }}"&gt;{{ post.title}}&lt;/a&gt;&lt;/h5&gt;
                            &lt;p class="meta small"&gt;{{ post.postDate | date('F d, Y') }} &lt;a href="#"&gt;Name&lt;/a&gt;&lt;/p&gt; 
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            {% endfor %}    
        {% else %}
            &lt;p&gt;You search for "{{ query }}" didn't retun any results&lt;/p&gt;
        {% endif %}
    &lt;/div&gt;
&lt;/main&gt;
</code></pre>

<p>Any thoughts?
Thanks.</p>

CC BY-SA 3.0
2016-11-23T20:07:31.167Z
You're not getting sent to `yoursite.com/search/results`?
Brad Bell
CC BY-SA 3.0
2016-11-23T20:49:09.813Z
The problem appears to be with the "{{ url('search/results') }}".  I can hard code it as "http://mysite.com/search/results" and it works.  For some reason, Craft/Twig is not printing the first part of the url.
Hellyar
CC BY-SA 3.0
2016-11-23T20:54:42.303Z
Probably an issue with how your siteUrl is defined (either in CP under Settings->General) or in your `craft/config/general.php` file.
Brad Bell
<templating><search>
Why isn't search working on the live page?
# Why isn't search working on the live page?

(Asked by: username_0 on 2016-11-23)

I have search working on my local .dev site.   It does not work on my live hosted site.  There are no error messages; it just reloads the home page.  
Here is the search code in my site template.  The results code is below...

    
    
        
        
    


The results page...
 
    

        {% if entries|length %}     
            {% for post in entries %}
                
                    

                                        
                            {{ post.title}}
                            {{ post.postDate | date('F d, Y') }} Name 
                        
                    
                
            {% endfor %}    
        {% else %}
            You search for "{{ query }}" didn't retun any results
        {% endif %}
    


Any thoughts?
Thanks.

**Tags:** templating, search
> **Comments:**
> **username_1**: You're not getting sent to `yoursite.com/search/results`?  
> **username_0**: The problem appears to be with the "{{ url('search/results') }}".  I can hard code it as "http://mysite.com/search/results" and it works.  For some reason, Craft/Twig is not printing the first part of the url.  
> **username_1**: Probably an issue with how your siteUrl is defined (either in CP under Settings->General) or in your `craft/config/general.php` file.  

---

## 0 answers

