diff --git a/src/search.rs b/src/search.rs index 6c8c1731..d30b1464 100644 --- a/src/search.rs +++ b/src/search.rs @@ -69,10 +69,14 @@ pub async fn find(req: Request) -> Result, String> { return Ok(redirect("/")); } - if query.starts_with("r/") { + if query.starts_with("r/") || query.starts_with("user/") { return Ok(redirect(&format!("/{query}"))); } + if query.starts_with("u/") { + return Ok(redirect(&format!("/user{}", &query[1..]))); + } + let sub = req.param("sub").unwrap_or_default(); let quarantined = can_access_quarantine(&req, &sub); // Handle random subreddits