Commit 48941fba authored by Maxwell Salzberg's avatar Maxwell Salzberg Committed by danielgrippi

DG MS; add rack-rewrite to handle forwarding old urls [ci skip]

parent c133c16d
......@@ -31,6 +31,7 @@ gem "rpm_contrib", "~> 2.1.7"
group :production do # we don't install these on travis to speed up test runs
gem 'rack-ssl', :require => 'rack/ssl'
gem 'rack-rewrite', '~> 1.2.1', :require => false
gem 'rack-google-analytics', :require => 'rack/google-analytics'
gem 'rack-piwik', :require => 'rack/piwik'
end
......
......@@ -298,6 +298,7 @@ GEM
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-piwik (0.1.2)
rack-rewrite (1.2.1)
rack-ssl (1.3.2)
rack
rack-test (0.5.7)
......@@ -487,6 +488,7 @@ DEPENDENCIES
pg
rack-google-analytics
rack-piwik
rack-rewrite (~> 1.2.1)
rack-ssl
rails (= 3.0.11)
rails-i18n
......
......@@ -180,6 +180,8 @@ defaults: &defaults
# with other pods
circumvent_ssl_requirement: false
image_redirect_url: ''
# Web tracking
# google analytics key - if false, no javascript included
......
if AppConfig[:image_redirect_url].present?
require 'rack-rewrite'
Rails.application.config.middleware.insert(0, Rack::Rewrite) do
r301 %r{/uploads/images/(.*)}, "#{AppConfig[:image_redirect_url]}/uploads/images/$1"
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment