diff --git a/config/routes.rb b/config/routes.rb index d71a9bbbe..fc27e0cb6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -109,6 +109,8 @@ Rails.application.routes.draw do resource :inbox, only: [:create], module: :activitypub + get '/:encoded_at(*path)', to: redirect("/@%{path}"), constraints: { encoded_at: /%40/ } + constraints(username: /[^@\/.]+/) do get '/@:username', to: 'accounts#show', as: :short_account get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies