Skip to content

Instantly share code, notes, and snippets.

@jodosha
Created April 28, 2009 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jodosha/103009 to your computer and use it in GitHub Desktop.
Save jodosha/103009 to your computer and use it in GitHub Desktop.
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class LegacyRoutes
class << self
def call(env)
if env["PATH_INFO"] =~ /^\/pages\//
[301, {"Location" => "/projects", "Content-Type" => "text/html"}, ["Moved Permanently"]]
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment