# Help! How to redirect if SSL applied

**URL:** <https://www.ruby-forum.com/t/help-how-to-redirect-if-ssl-applied/187780>\
**Category:** Rails\
**Created:** [April 29, 2010, 6:53am UTC](https://www.ruby-forum.com/t/help-how-to-redirect-if-ssl-applied/187780 "2010-04-29T06:53:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anaconda\_wly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/90db22/32.png) [@anaconda\_wly](https://www.ruby-forum.com/u/anaconda_wly)\
**Post date:** [April 29, 2010, 6:53am UTC](https://www.ruby-forum.com/t/help-how-to-redirect-if-ssl-applied/187780/1 "2010-04-29T06:53:33Z")

</div>

I’m working on the client side, the server had been applied with SSL.  
In my client, If the server is secured with SSL, the https shall be used  
automatically, or say “redirecting”;  
otherwise only use http to access the server.  
I didn’t know how to implement.  
I want to using ssl\_required plugin as some direction, but not succeed.  
I installed ssl\_requirement plugin.  
Then in coding as:  
require “ssl\_requirement”  
class MyController \< ApplicationController  
include SslRequirement  
ssl\_allowed :update  
##I tried ssl\_required :update An error occurred, saying:  
##The page is temporarily unavailable. (IIS-404)  
##while for ssl\_allowed :update the https still can’t be used, only go  
to http.

def update  
…  
respond\_to do |format|  
format.html {  
redirect\_to ( RelativeUrlfromLocalHost )  
}  
end  
end  
It doesn’t work.

In ssl\_required plugin, I saw the judgment :  
if ssl\_required? && !request.ssl?  
However, I’m not clear what is request here ? How can I “bind” it to  
my accessing server.  
Is there anyone can help me?  
Thanks alot!!
