Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

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

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

HTTPS mode and IIS


Go to End
Reply

24 Posts   134923 Views

Avatar
Minh

5 December 2007 at 6:33am Community Member, 5 Posts

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.

Avatar
Sigurd

5 December 2007 at 10:11am Forum Moderator, 628 Posts

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

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

Avatar
Sam

5 December 2007 at 11:03am Administrator, 679 Posts

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. :-)

Avatar
Minh

5 December 2007 at 11:18am Community Member, 5 Posts

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]

Avatar
Minh

5 December 2007 at 11:21am Community Member, 5 Posts

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'];
}

Avatar
Sam

5 December 2007 at 11:42am Administrator, 679 Posts

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 [url]http://doc.silverstripe.com/doku.php?id=iis-installation[/url]. It would be good if you could provide some installation instructions, if you have time.

Avatar
Minh

5 December 2007 at 12:13pm Community Member, 5 Posts

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.

Avatar
poyor

25 January 2008 at 4:54pm Community Member, 1 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

Go to Top