Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » http & https

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 974 Views
  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    http & https Link to this post

    Hi,

    A need has arisen for using both http and https within our site. I am curious how this works with silverstirpe - in my webroot there is 2 folders httpsdocs & httpdocs (where ss is), I can place stuff (like test.html) into the https and it shows with https://www.mysite.com/test.html. So I think I get an idea on how to working this... but...

    how does this mix with silverstripe?

    so do I duplicate my ss install into the httpsdocs?
    how do things link Director::BaseHref work when I need to transfer from one to another for various points through the user expiernce?
    is there any advice you guys could favor me with at this point?

    Barry

  • Devlin
    Avatar
    Community Member
    188 Posts

    Re: http & https Link to this post

    so do I duplicate my ss install into the httpsdocs?
    Why do you want to have two setups?

    how do things link Director::BaseHref
    Just do if($something) Director::forceSSL();
    Director::$alternateBaseURL works well too.

    is there any advice you guys could favor me with at this point?
    Well, sessions don't work when you move between protocols.

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: http & https Link to this post

    so do I duplicate my ss install into the httpsdocs? - Why do you want to have two setups?

    Not at all! - do I adjust the .htaccess or something? As I said I have two different folders in my site httpdocs (that is my webroot) and the other is httpsdoc. If I change the http:// to https:// the pages are served fromteh other folder and there is nothing it them. Am i missunderstanding - I should have both pointing to the same folder instead?

    how do things link Director::BaseHref
    Just do if($something) Director::forceSSL(); else Director::forceWWW();
    Director::$alternateBaseURL works well too.

    Many thanks - are there any other tips you have?

    is there any advice you guys could favor me with at this point? - Well, sessions don't work when you move between protocols.

    Hmmmm that means that as soon as I start something that requires sessions I'll have to transfer. Then if the users transfers back they will lose their session? if they put the right protcol in again will it reuse the previous session?

    Again Many thanks for you answers Devlin.

  • Devlin
    Avatar
    Community Member
    188 Posts

    Re: http & https Link to this post

    Am i missunderstanding - I should have both pointing to the same folder instead?

    I don't know your setup. For simplicity's sake I would just set the https&http DocumentRoot to the same folder and let Silverstripe do its work. When your hoster doesn't allow you to do so, then you have a problem. Maybe a symlink would do.

    Many thanks - are there any other tips you have?

    SS with HTTPS on a shared webhoster through a ssl proxy...
    http://silverstripe.org/general-questions/show/13844

    ...they will lose their session?
    if they put the right protcol in again will it reuse the previous session?

    Yeah.

    974 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.