Forum: Ruby on Rails Linking in SSL page to non SSL

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nik B (Guest)
on 2008-12-15 18:45
(Received via mailing list)
I have a situation where I am generating links in an SSL secured area
(no subdomain) to a non SSL page (with a subdomain). The certificate
doesn't cover subdomains, so everytime someone clicks on the link to a
https:// page where SSL isn't allowed there is a certificate error.

Now users can click okay, and then they are redirected to the http://
page, but I would like to create the link directly to http:// rather
than https://

I'm using the ssl_requirement plugin. Is there a way to do this?

Fernando P. (Guest)
on 2008-12-15 19:53
> I'm using the ssl_requirement plugin. Is there a way to do this?
> Thanks,
> N

Hi, we use the same plugin at, we
experienced the same problems. The main gotcha, is that you are
certainly using some_resource_path in your link_to instead of

Because with _path, the protocol used is the one of the current page
because it actually generates relative paths. Using _url, the protocol
of the page generated can be different as it generates absolute paths.

Have you also edited routes.rb to add the correct protocol?

French training using VoD:
Nik B (Guest)
on 2008-12-15 20:44
(Received via mailing list)
We're actually having to use URL for because of the subdomain plugin
creates malformed urls for nested resources :-(

On Dec 15, 12:53 pm, Fernando P. <removed_email_address@domain.invalid>
Nik B (Guest)
on 2008-12-15 23:20
(Received via mailing list)
Fixed - thanks Fernando to get me on the right track. Once I looked up
protocol in routes I found this post and solved my problem:
This topic is locked and can not be replied to.