Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » HTTPS mode and IIS

Our old forums are still available as a read-only archive.

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

Page: 1 2 3
Go to End
Author Topic: 134879 Views
  • Minh
    Avatar
    Community Member
    5 Posts

    HTTPS mode and IIS Link to this post

    Just noticed Director.php it was using this to check for HTTPS mode:

    isset($_SERVER['HTTPS'])

    Had to change it to:

    isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"

    Because my IIS $_SERVER['HTTPS'] variable is equal to "off", which pass the issset test.

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: HTTPS mode and IIS Link to this post

    You can merely have $_SERVER['HTTPS'] == "on"

    because the second expression will require the first expression to be true anyway

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: HTTPS mode and IIS Link to this post

    Minh - we haven't worked much with IIS to its encouraging to hear that you have had success in getting SilverStripe working. How did you tackle URL rewriting?

    PS: Please don't take Sig's suggestion - it would cause an E_NOTICE level error if $_SERVER['HTTPS'] isn't set. Your code is good.

  • Minh
    Avatar
    Community Member
    5 Posts

    Re: HTTPS mode and IIS Link to this post

    Sam,

    I'm using the ISAPI_FILTER for mod_rewrite. Here's my .htaccess code incase anyone needed it. I couldn't figure out the second condition so I left it out for now and just add additional file extension to the first condition.

    [ISAPI_Rewrite]
    RewriteEngine On
    RewriteBase /silverstripe_root_directory_name/
    RewriteCond $1 !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.swf)|(\.html)|(\.php)$
    RewriteRule ^(.*)$ sapphire/main.php?url=$1&%{QUERY_STRING} [L]

  • Minh
    Avatar
    Community Member
    5 Posts

    Re: HTTPS mode and IIS Link to this post

    Another thing that I had to do is set $_SERER['REQUEST_URI'] because that server env doesn't exist in IIS. Here's a bit of code that I've added at the top of /sapphire/main.php

    if(!isset($_SERVER['REQUEST_URI'])){
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
    }

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: HTTPS mode and IIS Link to this post

    Minh - are you familiar with downloading SilverStripe via subversion and then using subversion to create a patch file? It's a good way of discovering *all* of the little changes that you needed to make in order to get SilverStripe working on IIS.

    I've started a short page about IIS installation at http://doc.silverstripe.com/doku.php?id=iis-installation. It would be good if you could provide some installation instructions, if you have time.

  • Minh
    Avatar
    Community Member
    5 Posts

    Re: HTTPS mode and IIS Link to this post

    Sam,

    I can help with the IIS installation documentation. But applying svn patch would not be possible because I don't have direct access to the Windows box that's hosting the site. So I couldn't get tortoise svn going. Unless you could think of another way.

  • poyor
    Avatar
    Community Member
    1 Post

    Re: HTTPS mode and IIS Link to this post

    where can we have a free version of helicon? is there any open source. Hoping that anyone success to install and get working with silver stripe on IIS, would write a complete how-to page

    134879 Views
Page: 1 2 3
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.