Open gabyshev opened 8 years ago
I'm not sure. Is there a way to get the current subdomain before redirecting?
For example: request url:
abc.mysite.com/audio/song.mp3
And I want it to be redirected here
mysite.com/abc/audio/song.mp3
maybe something like:
r301 %r{^(/audio/(.*)}, lambda { |match, rack_env| subdomain = rack_env['SERVER_NAME'].split('.')[0] "http://mysite.com/#{subdomain}/audio/#{match[1]}" }
I'm not sure. Is there a way to get the current subdomain before redirecting?
For example: request url:
And I want it to be redirected here