From 8d71420b4511fdac63c39f33d93c7add1ea7716d Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Mon, 29 Jul 2019 21:25:05 -0700 Subject: [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. --- searx/templates/simple/infobox.html | 2 +- searx/templates/simple/results.html | 14 +++++++------- searx/templates/simple/search.html | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'searx/templates/simple') diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html index 08daa5038..56c51af77 100644 --- a/searx/templates/simple/infobox.html +++ b/searx/templates/simple/infobox.html @@ -33,7 +33,7 @@

{{ topic.name }}

{% for suggestion in topic.suggestions %} -
+ diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index 2e393193f..936de8831 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -1,7 +1,7 @@ {% extends "simple/base.html" %} {% from 'simple/macros.html' import icon, icon_small %} {% block title %}{% if method == 'GET' %}{{- q|e -}} -{% endif %}{% endblock %} -{% block meta %}{% endblock %} +{% block meta %}{% endblock %} {% block content %} {% include 'simple/search.html' %} @@ -55,7 +55,7 @@

{{ _('Suggestions') }} :

{% for suggestion in suggestions %} - + @@ -71,13 +71,13 @@

{{ _('Search URL') }} :

-
{{ base_url }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}
+
{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}

{{ _('Download results') }}

{% for output_type in ('csv', 'json', 'rss') %}
- + {% for category in selected_categories %} @@ -100,7 +100,7 @@

{{ _('Try searching for:') }}

{% for correction in corrections %}
- + @@ -133,7 +133,7 @@ {% if paging %}