Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:41:16+00:00 2026-05-26T03:41:16+00:00

I want to have mixed https/http site. Moreover I want have redirects from https

  • 0

I want to have mixed https/http site.

Moreover I want have redirects from https to http(ie. after user login successfully it should redirect to root page at http).

Gems like:

  • rack-ssl
  • rack-ssl-enforcer

works perfectly but only If you want to have entire site at https
“Mixed http/https” with only ssl at A, B, C actions and only http at D, E, F – dont work.

I checked solution from another SO thread:

Rails 3 SSL routing redirects from https to http

Almost works.
Its easy to write script which will change(on entire views) helper from “_path” to “_url”.

But there is a problem with links like:

<%= link_to "model", some_model %>
<%= link_to "edit model", edit_mode_url(model) %>
...

There are many diffrent models and I use often “model” at iteration blocks, so solution based on ‘rewrite’ script will dont work with that.

Questions:

Is there a way to change behavior of <%= link_to 'model', model %> code to fix that? Is there a possibility to overwrite path helper(standard protocol will be http, on giver parameter – https)?

Or maybe there is a another solution which I have not found yet?

Edit:

I work with Rails 3.0.9.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:41:16+00:00Added an answer on May 26, 2026 at 3:41 am

    Use this gem:

    https://github.com/retr0h/ssl_requirement

    gem install ssl_requirement

    Then to add ssl_required :new, :destroy #others actions
    to your controllers.

    If you use devise you have to overwrite each controller and specify all actions

    devise_for :users, :controllers => { :confirmations => "confirmations", :omniauth_callbacks => "omniauth_callbacks", :passwords => "passwords",  :registrations => "registrations", :sessions => "sessions", :unlocks => "unlocks" } do
    # etc
    end
    

    It works with Rails 3.0.x

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL database of keywords that are presently mixed-case. However, I want
I have a bunch of items (text, image, mixed content, etc) that I want
I want to have a text box that the user can type in that
I have a mixed-mode application in which I want to fire up the debugger
i want have an image and i want to set it as a background
want to have a Hyperlink-Button in a gridView in which I can display a
I want to have a select-only ComboBox that provides a list of items for
I want to have a PHP script send a XML formatted string to another
I want to have a class which implements an interface, which specifies the specific
I want to have a web based admin to upload, delete files and folders

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.