Commit 1a9de54c by Peter Serwylo

Redirect `?fdcategory=System` et al to `/packages/category/System`

parent 004390cb
......@@ -64,6 +64,33 @@ RewriteRule ^(.*)$ /packages/%1/? [L,R=301]
##
## CATEGORIES
##
## Categories are browsed using the `fdcategory` query parameter.
## Note: This is often specified twice, and if so, the latter is used. This is categored for because
## the first .* is greedy, so will consume any prior `fdcategory=` strings before capturing the last.
##
#
# Rewrites:
# /any/path?leading_param=blah&fdcategory=System&trailing_param=blah -> /packages/category/System/
# /any/path?fdcategory=System&trailing_param=blah -> /packages/category/System/
#
RewriteCond %{QUERY_STRING} ^.*fdcategory=(.*?)&.*$
RewriteRule ^(.*)$ /packages/category/%1/? [L,R=301]
#
# The less specific version of the above rule, for when there is no trailing parameters.
# Rewrites:
# /any/path?leading_param=blah&fdcategory=System -> /packages/category/System/
# /any/path?fdcategory=System -> /packages/category/System/
#
RewriteCond %{QUERY_STRING} ^.*fdcategory=(.*)$
RewriteRule ^(.*)$ /packages/category/%1/? [L,R=301]
##
## MISC PAGES
##
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment