Forum

Thread tagged as: Problem

Search path not correct

When I try to enter a search term I don't get any results and the page goes to https://reach.kubiaktest.co.uk/?q=Lorem

but the results appear here https://reach.kubiaktest.co.uk/search.php?q=Lorem

Obviously there's something going wrong with my paths. How do I make sure when entering the form the right page is brought back?

Does that even make sense?

Emily Taylor

Emily Taylor 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What path have you set in the action on your search form?

I don't know where I would find that, could you elaborate please? As far as I know I'm just using the default, I haven't changed the action at all.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us your search form template?

<perch:form id="search" class="search" method="get">
    <div>
        <perch:input type="search" id="q" placeholder="search" />
        <perch:input type="submit" class="go" value="Go" />
    </div>
</perch:form>
Drew McLellan

Drew McLellan 2638 points
Perch Support

That will send the form to whichever page it's on. If you want to send the query specifically to a search page, set it in the action:

<perch:form id="search" class="search" method="get" action="/search.php">

Ah ok, I did not realise you needed an action but now I see. Being a bit thick!

Thanks Drew.