Skip to content

Commit

Permalink
Update .htaccess to correctly handle search queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
pserwylo committed Sep 25, 2017
1 parent 3aac25b commit a61e4bd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ RewriteEngine On
# trailing parameters.
#
# Rewrites:
# /any/path?leading_param=blah&fdfilter=query&trailing_param=blah -> /packages/search/query
# /any/path?fdfilter=query&trailing_param=blah -> /packages/search/query
# /any/path?leading_param=blah&fdfilter=query&trailing_param=blah -> /packages/#q=query
# /any/path?fdfilter=query&trailing_param=blah -> /packages/#q=query
#
RewriteCond %{QUERY_STRING} ^.*fdfilter=(.*?)&.*$

Expand All @@ -34,16 +34,16 @@ RewriteCond %{QUERY_STRING} ^.*fdfilter=(.*?)&.*$
# from the original request. By having "?" here, it shows no query string at all, which
# is what we are after.
#
RewriteRule ^(.*)$ /packages/search/%1? [L,R=301]
RewriteRule ^(.*)$ /packages/#q=%1? [L,R=301,NE]

#
# The less specific version of the above rule, for when there is no trailing parameters.
# Rewrites:
# /any/path?leading_param&fdfilter=query -> /packages/search/query
# /any/path?fdfilter=query -> /packages/search/query
# /any/path?leading_param&fdfilter=query -> /packages/#q=query
# /any/path?fdfilter=query -> /packages/#q=query
#
RewriteCond %{QUERY_STRING} ^.*fdfilter=(.*?)$
RewriteRule ^(.*)$ /packages/search/%1? [L,R=301]
RewriteRule ^(.*)$ /packages/#q=%1? [L,R=301,NE]



Expand Down

0 comments on commit a61e4bd

Please sign in to comment.