Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@
resources :shortlinks, except: :show

# Redirect to prot's subdomain, keeping the path and any extensions in the request
match '/mediawiki(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://prot-hkn.eecs.berkeley.edu/w/#{ params[:path] }#{ '.' + params[:format] if params[:format].present?}") }
match '/prot(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://prot-hkn.eecs.berkeley.edu/wiki/#{ params[:path] }#{ '.' + params[:format] if params[:format].present?}") }
match '/prot2(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://prot-hkn.eecs.berkeley.edu/w/#{ params[:path] }#{ '.' + params[:format] if params[:format].present?}") }
match '/mediawiki(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://prot-hkn.eecs.berkeley.edu/w/#{ URI.escape(params[:path]) }#{ '.' + URI.escape(params[:format]) if params[:format].present?}", "[]") }
match '/prot(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://prot-hkn.eecs.berkeley.edu/wiki/#{ URI.escape(params[:path]) }#{ '.' + URI.escape(params[:format]) if params[:format].present?}", "[]") }
match '/prot2(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://prot-hkn.eecs.berkeley.edu/w/#{ URI.escape(params[:path]) }#{ '.' + URI.escape(params[:format]) if params[:format].present?}", "[]") }

# Redirect some alumni sites that were discontinued but requested redirects to
# prevent any old links breaking
Expand All @@ -410,8 +410,8 @@
match '/~calbear/research.html', via: :all, to: redirect { "http://research.mbbaer.com/" }
match '/~calbear/research/', via: :all, to: redirect { "http://mbbaer.com/" }

match '/~chenm(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://www.ocf.berkeley.edu/~morganjchen/#{ params[:path] }#{ '.' + params[:format] if params[:format].present?}") }
match '/~dyoo(/*path)', via: :all, to: redirect { |params, _| URI.encode("http://www.hashcollision.org/hkn/#{ params[:path] }#{ '.' + params[:format] if params[:format].present?}") }
match '/~chenm(/*path)', via: :all, to: redirect { |params, _| URI.encode("https://www.ocf.berkeley.edu/~morganjchen/#{ URI.escape(params[:path]) }#{ '.' + URI.escape(params[:format]) if params[:format].present?}", "[]") }
match '/~dyoo(/*path)', via: :all, to: redirect { |params, _| URI.encode("http://www.hashcollision.org/hkn/#{ URI.escape(params[:path]) }#{ '.' + URI.escape(params[:format]) if params[:format].present?}", "[]") }

# This section must remain at the bottom of the routes, since they are
# catch-all routes to enable arbitrary hierarchy and placement of static pages
Expand Down