# Linking in SSL page to non SSL

**URL:** <https://www.ruby-forum.com/t/linking-in-ssl-page-to-non-ssl/155696>\
**Category:** Rails\
**Created:** [December 15, 2008, 5:45pm UTC](https://www.ruby-forum.com/t/linking-in-ssl-page-to-non-ssl/155696 "2008-12-15T17:45:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [December 15, 2008, 5:45pm UTC](https://www.ruby-forum.com/t/linking-in-ssl-page-to-non-ssl/155696/1 "2008-12-15T17:45:26Z")

</div>

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?

Thanks,  
N

---

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [December 15, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/linking-in-ssl-page-to-non-ssl/155696/2 "2008-12-15T18:53:18Z")

</div>

> I’m using the ssl\_requirement plugin. Is there a way to do this?
> 
> Thanks,  
> N

Hi, we use the same plugin at [https://www.digiprof.fr/login](https://www.digiprof.fr/login), we  
experienced the same problems. The main gotcha, is that you are  
certainly using some\_resource\_path in your link\_to instead of  
some\_resource\_url.

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: [http://www.digiprof.fr](http://www.digiprof.fr)

---

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [December 15, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/linking-in-ssl-page-to-non-ssl/155696/3 "2008-12-15T19:44:02Z")

</div>

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](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [December 15, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/linking-in-ssl-page-to-non-ssl/155696/4 "2008-12-15T22:20:49Z")

</div>

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:  
[http://siannopollo.blogspot.com/2007/08/rails-and-ssl-https.html](http://siannopollo.blogspot.com/2007/08/rails-and-ssl-https.html)
