Sha256: 61b175d708adaf79b6398c8c1dfe47a69151523afbfc059edb83b1d7d2356dee

Contents?: true

Size: 255 Bytes

Versions: 9

Compression:

Stored size: 255 Bytes

Contents

class RedirectLegacyProductUrl

  def self.call(env)                
    if env["PATH_INFO"] =~ %r{/t/.+/p/(.+)}      
      return [301, {'Location'=> "/products/#{$1}" }, []]  
    end
    [404, {"Content-Type" => "text/html"}, "Not Found"]
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree-0.11.4 app/metal/redirect_legacy_product_url.rb
spree-0.11.3 app/metal/redirect_legacy_product_url.rb
spree-0.11.2 app/metal/redirect_legacy_product_url.rb
spree-0.11.1 app/metal/redirect_legacy_product_url.rb
spree-0.11.0 app/metal/redirect_legacy_product_url.rb
spree-0.10.2 app/metal/redirect_legacy_product_url.rb
spree-0.10.1 app/metal/redirect_legacy_product_url.rb
spree-0.10.0 app/metal/redirect_legacy_product_url.rb
spree-0.10.0.beta app/metal/redirect_legacy_product_url.rb