communities redirect fix

This commit is contained in:
Ryan Stafford 2023-07-23 15:18:14 -04:00
parent 9525c1ff4d
commit 3ce346d815

View file

@ -418,7 +418,10 @@ func GetFrontpage(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func GetCommunities(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
r.URL.Path = "/search"
r.URL.RawQuery = "searchtype=Communities"
if ps.ByName("host") != "" {
r.URL.Path = "/" + ps.ByName("host") + "/search"
}
r.URL.RawQuery = "searchtype=Communities&sort=TopMonth"
http.Redirect(w, r, r.URL.String(), 301)
}