summaryrefslogtreecommitdiff
path: root/searx/templates/simple/results.html
diff options
context:
space:
mode:
authorMarc Abonce Seguin <marc-abonce@mailbox.org>2019-07-29 21:25:05 -0700
committerMarc Abonce Seguin <marc-abonce@mailbox.org>2020-11-02 20:04:03 -0700
commit8d71420b4511fdac63c39f33d93c7add1ea7716d (patch)
tree14f3e1e9cf815cf5cc301fb1699cd54816adfc25 /searx/templates/simple/results.html
parent45f58a4a2a0b89f4b416c28ea769139b16f6436d (diff)
downloadsearxng-8d71420b4511fdac63c39f33d93c7add1ea7716d.tar.gz
searxng-8d71420b4511fdac63c39f33d93c7add1ea7716d.zip
[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.
Diffstat (limited to 'searx/templates/simple/results.html')
-rw-r--r--searx/templates/simple/results.html14
1 files changed, 7 insertions, 7 deletions
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 %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language }}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %}
+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language }}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %}
{% block content %}
<nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav>
{% include 'simple/search.html' %}
@@ -55,7 +55,7 @@
<h4 class="title">{{ _('Suggestions') }} : </h4>
<div class="wrapper">
{% for suggestion in suggestions %}
- <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
<input type="hidden" name="q" value="{{ suggestion.url }}">
<input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="language" value="{{ current_language }}">
@@ -71,13 +71,13 @@
<div id="search_url">
<h4 class="title">{{ _('Search URL') }} :</h4>
- <div class="selectable_url"><pre>{{ base_url }}?q={{ q|urlencode }}&amp;language={{ current_language }}&amp;time_range={{ time_range }}&amp;safesearch={{ safesearch }}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&amp;timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div>
+ <div class="selectable_url"><pre>{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&amp;language={{ current_language }}&amp;time_range={{ time_range }}&amp;safesearch={{ safesearch }}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&amp;timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div>
</div>
<div id="apis">
<h4 class="title">{{ _('Download results') }}</h4>
{% for output_type in ('csv', 'json', 'rss') %}
<div class="left">
- <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
<input type="hidden" name="q" value="{{ q|e }}">
{% for category in selected_categories %}
<input type="hidden" name="category_{{ category }}" value="1">
@@ -100,7 +100,7 @@
<h4>{{ _('Try searching for:') }}</h4>
{% for correction in corrections %}
<div class="left">
- <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation">
<input type="hidden" name="q" value="{{ correction.url }}">
<input type="hidden" name="time_range" value="{{ time_range }}">
<input type="hidden" name="language" value="{{ current_language }}">
@@ -133,7 +133,7 @@
{% if paging %}
<nav id="pagination">
{% if pageno > 1 %}
- <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
<div class="{% if rtl %}right{% else %}left{% endif %}">
<input type="hidden" name="q" value="{{ q|e }}" >
{% for category in selected_categories %}
@@ -149,7 +149,7 @@
</div>
</form>
{% endif %}
- <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
+ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
<div class="{% if rtl %}left{% else %}right{% endif %}">
<input type="hidden" name="q" value="{{ q|e }}" >
{% for category in selected_categories %}