Ok, I hit my head against a brick wall with this - any help was greatly appreciated!
I redirect old URLs and, for the most part, easily and efficiently, for example:
match '/pages/holiday-specials/', :to => redirect( "/accommodation", :status => 301 )
However, I need a special catch-all rule that should do some regular expression checking. It works well. WITH THE EXCEPTION OF. I can’t get him to convey status. This redirects and does what I need, but does not send status 301:
match '/*:path', :to => redirect( lambda { |params| "/operator/#{/[^\d](\d+)([^\d]|$)/.match(params[:path])[1]}" }, :status => 301)
Any ideas?
source
share