diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 49e5f0c..9cf4de2 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -101,10 +101,11 @@ public function postAction(Request $request): RedirectResponse $query = (array) $request->request->all()['monsieurbiz_searchplugin_search'] ?? []; $query = $query['query'] ?? ''; + // With Apache a URL with a encoded slash (%2F) is provoking a 404 error on the server level return $this->redirect( $this->generateUrl( 'monsieurbiz_search_search', - ['query' => urlencode($query)] + ['query' => str_replace('%2F', '/', urlencode($query))] ) ); } diff --git a/src/Resources/views/Search/_filters.html.twig b/src/Resources/views/Search/_filters.html.twig index b183f23..fc43573 100644 --- a/src/Resources/views/Search/_filters.html.twig +++ b/src/Resources/views/Search/_filters.html.twig @@ -8,8 +8,8 @@ {{ 'monsieurbiz_searchplugin.filters.no_filter'|trans }} {% else %} - {% set encodedQuery = app.request.attributes.get('_route_params').query|default('')|url_encode %} - {% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge(app.request.query.all)|merge({query: encodedQuery})) %} + {% set searchQuery = app.request.attributes.get('_route_params').query|default('') %} + {% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge(app.request.query.all)|merge({query: searchQuery})) %}
{% for filter in result.filters %} diff --git a/src/Resources/views/Search/_tabs.html.twig b/src/Resources/views/Search/_tabs.html.twig index 21a6c47..f4a05d7 100644 --- a/src/Resources/views/Search/_tabs.html.twig +++ b/src/Resources/views/Search/_tabs.html.twig @@ -1,12 +1,12 @@ {% if documentableRegistries|length > 1%}