redirecting from http://example.com to https://example.mysite.com

前端 未结 2 1501
执念已碎
执念已碎 2020-12-30 18:53

This question has been asked in various permutations, but I haven\'t found the right combination that answers my particular question.

The configuration

    <
相关标签:
2条回答
  • 2020-12-30 19:20

    You should have a look at rack-rewrite - it's essentially Apache re-write but in Ruby form, and usable on Heroku.

    This will allow you to create all sorts of Rack level rules and what redirections etc should occur and when.

    0 讨论(0)
  • 2020-12-30 19:30

    you can redirect to a different hostname by doing the following:

    # file: controllers/application_controller.rb
    class ApplicationController < ActionController::Base
      force_ssl :host => "secure.example.com"
    end
    

    see: rails force_ssl source for more info

    0 讨论(0)
提交回复
热议问题