Thanks very much for your suggestions. I created the file in models and modified a url helper to use it and received the following error:
TypeError: URL() got an unexpected keyword argument 'secure' A few follow up questions: 1. Did you intend to say 'model' rather than module? 2. How do I integrate 0_redefine_url.py into my app such that the URL helper will accept the keyword argument 'secure'? Thanks - Jay On Dec 10, 5:50 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > I would suggest creating a model 0_redefine_url.py that contains: > > _URL=URL > def URL(*a,**b): > if not 'secure' in b: > return _URL(*a,**b) > elif b['secure']: > del b['secure'] > return 'https://'+request.env.http_host + _URL(*a,**b) > else: > del b['secure'] > return 'http://'+request.env.http_host + _URL(*a,**b) > > and use URL(....,secure=True), URL(...secure=False) as required > > Massimo > > 'https://'+request.env.http_host +'/app/default/logon') > > On Dec 10, 2:11 pm, Wes James <compte...@gmail.com> wrote: > > > > > Actually, I don't think it would matter if there were a proxy or not?? > > > On Thu, Dec 10, 2009 at 1:06 PM, Wes James <compte...@gmail.com> wrote: > > > As long as you don't have a proxy between your users and the server > > > something with request.env could be used > > > > def login(): > > > if request.env.port != 443: > > > redirect('https://'+request.env.http_host +'/app/default/logon') > > > > -wes > > > > On Thu, Dec 10, 2009 at 11:42 AM, Jay <j...@unclehenrys.com> wrote: > > >> I am new to web2py and Apache w/mod_ssl and I have been searching > > >> for > > >> a solution related to this topic but I must be missing a basic > > >> understanding of the necessary pieces in order to accomplish this. > > > >> Our web2py apache setup seems to be fine. I can access our app's > > >> pages using both http and https if I manually add the 's' to the url. > > > >> What we are trying to do is smoothly transition from one controller/ > > >> function using http to another using https. > > >> Example, a user arrives athttp://init/default/indexandthen the > > >> user > > >> selects ‘Login’ and they are sent to https:/init/default/login. We > > >> need some controller functions to use http and some https. Can this > > >> be done from within the controller/function? If not, what is the > > >> ‘best practice’ approach to accomplishing this? > > > >> - Jay > > > >> -- > > > >> You received this message because you are subscribed to the Google > > >> Groups "web2py-users" group. > > >> To post to this group, send email to web...@googlegroups.com. > > >> To unsubscribe from this group, send email to > > >> web2py+unsubscr...@googlegroups.com. > > >> For more options, visit this group > > >> athttp://groups.google.com/group/web2py?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.