mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[mod] separate index and search routes
This makes it easier to separately handle search and index requests from a web server or from a reverse proxy. If a request to index contains a query, a permanent redirect HTTP response is returned. This should give some level of backwards compatibility for users that have set a searx instance in their browser's search bar.
This commit is contained in:
parent
45f58a4a2a
commit
8d71420b45
17 changed files with 70 additions and 42 deletions
|
|
@ -6,9 +6,9 @@
|
|||
<Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
|
||||
<LongName>searx metasearch</LongName>
|
||||
{% if opensearch_method == 'get' %}
|
||||
<Url rel="results" type="text/html" method="get" template="{{ host }}?q={searchTerms}"/>
|
||||
<Url rel="results" type="text/html" method="get" template="{{ url_for('search', _external=True) }}?q={searchTerms}"/>
|
||||
{% else %}
|
||||
<Url rel="results" type="text/html" method="post" template="{{ host }}">
|
||||
<Url rel="results" type="text/html" method="post" template="{{ url_for('search', _external=True) }}">
|
||||
<Param name="q" value="{searchTerms}" />
|
||||
</Url>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue