I switched my app's domain, and the redirect works for urls that use http, but I have some links lurking around on the web using HTTPS that aren't redirecting.
For instance, http://myolddomain.com redirects just fine, but https://myolddomain.com results just returns a generic server error. Is it possible to redirect these links? I'm using rails 3 and heroku.
UPDATE:
I'm trying the rack-rewrite gem. Here's the code that I'm adding to my production environment file:
#mod_rewrite using rack-rewrite gem
config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
rewrite '^https://www.myolddomain.com/(.*)$', 'https://www.mynewdomain.com/$1'
rewrite '^https://myolddomain.com/(.*)$', 'https://www.mynewdomain.com/$1'
end
It's successfully redirecting https://myolddomain.com but not https://www.myoldomain.com. It's also throwing an error for the ssl certificate, "Server's certificate does not match the URL."