I have 2 websites both built in ExpressionEngine 3.5.10.
Both use the {exp:search:simple_form}
tag to provide a basic search facility.
One of the sites works absolutely fine. But the other doesn't - if I do a search for a valid term (by looking at the content in the Admin panel) it will give me a list of results, but the URL to the entry is incorrect. So it results in a 404 error when the user clicks on a result.
The search form syntax is like this:
{exp:search:simple_form channel="news|services|resources|contact_us|about_us|pages|team" no_result_page="search/noresults" results="10" search_in="entries" status="open" where="any"}
I have a few entries in the services
channel. If I search for a valid phrase within the content it is producing these URLs:
The above will result in 404 errors - the correct URL has services
before the slug. So they should be:
The syntax in my results template (search/results.html
) to display the URL's is the same on both websites:
{exp:search:search_results}
<a href="{auto_path}">{title}</a>
<p>{excerpt}</p>
{/exp:search:search_results}
The problem seems to be arising from the {auto_path}
bit because that's what's outputting the URL.
I'm unsure why it works ok on 1 website and not the other. They are separate websites but am sure they have been set up and configured in the same way.
Is there some other setting needed to make my URLs work correctly? Very confusing and slightly annoying that this doesn't just work out of the box.