Skip to content

Commit

Permalink
communities redirect fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rystaf committed Jul 23, 2023
1 parent 9525c1f commit 3ce346d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 3ce346d

Please sign in to comment.