Skip to content

A platform for community discussion. Free, open, simple.

DEV: Move the catch-all route to the bottom (#32798)

Jarek Radosz1e368a04ecdf
diff --git a/config/routes.rb b/config/routes.rb
index 3683ed130b2..85f2b2f6731 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1765,8 +1765,6 @@ Discourse::Application.routes.draw do
post "/pageview" => "pageview#index"
- get "*url", to: "permalinks#show", constraints: PermalinkConstraint.new
-
get "/form-templates/:id" => "form_templates#show"
get "/form-templates" => "form_templates#index"
@@ -1778,5 +1776,8 @@ Discourse::Application.routes.draw do
get "/test_net_http_timeouts" => "test_requests#test_net_http_timeouts"
get "/test_net_http_headers" => "test_requests#test_net_http_headers"
end
+
+ # This catch-all route should always be last
+ get "*url", to: "permalinks#show", constraints: PermalinkConstraint.new
end
end