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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

HTTPS mode and IIS


Go to End


24 Posts   137158 Views

Avatar
Minh

Community Member, 5 Posts

5 December 2007 at 6:33am

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

Forum Moderator, 628 Posts

5 December 2007 at 10:11am

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

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

Avatar
Sam

Administrator, 690 Posts

5 December 2007 at 11:03am

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

Community Member, 5 Posts

5 December 2007 at 11:18am

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

Community Member, 5 Posts

5 December 2007 at 11:21am

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

Administrator, 690 Posts

5 December 2007 at 11:42am

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.

Avatar
Minh

Community Member, 5 Posts

5 December 2007 at 12:13pm

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

Community Member, 1 Post

25 January 2008 at 4:54pm

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