0
Hier mein Ruby-Umleitung ist auf Rails-Code eine Anfrage https://example.com
-https://www.example.com
zu umleiten:Rubin in Rails www Sub-Domain
class ApplicationController < ActionController::Base
before_filter :add_www_subdomain
private
def add_www_subdomain
if Rails.env.production?
unless /^www/.match(request.host)
redirect_to("#{request.protocol}www.#{request.host_with_port}",status: 301)
end
end
end
end
Nun ist die Frage, wenn jemand an https://example.com/product/abc
landet sie angeblich zu https://www.example.com
umgeleitet werden, sie sollten zu https://www.example.com/product/abc
gehen. Gibt es einen Trick dafür? Danke