Jump to:

4945 Posts in 17789 Topics by 1494 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » HELP!!! Rewrite on IIS 6 :(

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 3957 Views
  • veritopaz
    Community Member
    1 Post

    HELP!!! Rewrite on IIS 6 :( Link to this post

    Hi Everyone!

    I´ve had always use Apache + PHP + MySQL for Silverstripe.
    Now, I need to mount a new Site on a IIS6 +PHP + MySQL server.
    PHP + MySQL works fine.
    The problem I have it's Rewrite Conditions on IIS.

    I've tried with Ionics Isapi Rewrite Filter and ISAPI_Rewrite 2, but I didn´t have lucky.

    Does anyone work with this before?
    I need a tutorial, step by step please!

    Thanks a lot!


  • kcd
    Community Member
    54 Posts

    Re: HELP!!! Rewrite on IIS 6 :( Link to this post

    It can be done, I have it working just fine

    Once you have IIRF (version 2) installed use the following ini in your silverstripe directory.

    # IIRF.ini
    # Rewriting ON (on by default)
    RewriteEngine ON

    # Status local only - add 'RemoteOK' for remote debugging
    StatusUrl /iirfStatus

    # Log
    RewriteLog C:\Inetpub\Log\IIRF.log
    RewriteLogLevel 1

    RewriteEngine On
    MaxMatchCount 10
    IterationLimit 5

    # URLs with query strings
    # Don't catch successful file references
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)\?(.+)$ /sapphire/main.php?url=$1&$2

    # URLs without query strings
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /sapphire/main.php?url=$1

    I vaguely recall editing the base url in index.php but I cannot remember if this is necessary. My base url is:

    // This is the URL of the script that everything must be viewed with.

  • Sean
    Forum Moderator
    921 Posts

    Re: HELP!!! Rewrite on IIS 6 :( Link to this post

    I've confirmed this and SilverStripe works with IIRF on Windows Server 2003 R2 using IIS 6. I also used PHP 5.3.3 and MySQL 5.1.51.

    Unit tests pass, even:

    cd C:\Inetpub\wwwroot\ss24
    php sapphire\cli-script.php dev/tests/all

    851 tests run: 851 passes, 0 fails, and 0 exceptions
    Maximum memory usage: 80.2M

    Total time: 124.351 seconds

    124 seconds for a full pass isn't bad for an older copy of Windows! For performance, it's also important you update everything on Server 2003, including .NET Framework updates and service packs (important!). Then you can use a VC9 non-thread safe version of PHP and the latest MySQL 5.1.51. I installed my copy of PHP manually, as well.

    Not only that, but the /admin URL is working correctly. The main thing is you need to create a new "vhost", which means creating a new entry under "Web Sites" in IIS 6, pointing it to a location in C:\Inetpub\wwwroot\silverstripe (or the directory you want) then putting an Iirf.ini file into that directory for rewriting to work.

    I've got the start of a step-by-step tutorial, which also explains how to install FastCGI and PHP on Windows Server 2003, so I'll finish that up and post it on http://doc.silverstripe.com

    EDIT: Guide available here: http://doc.silverstripe.org/installation-on-windows-server-2003-iis-6


  • marc79
    Community Member
    65 Posts

    Re: HELP!!! Rewrite on IIS 6 :( Link to this post


    I need to host a ss site, which works perfectly well on both my localhost and a Linux shared hosting package i have, on a windows server. It's 2003 with IIS6 and IIRF 2.1.

    I have tried everything but still can't get the site to see the css, js or any image files. All the text is there and the navigation works, you can click between pages without a problem and you don't need to add index.php. In fact if you add index.php it comes back with 'page not found'. This is the same if I try entering the file path of any image or css file directly into my browser.

    Any suggestions would be greatly received.

    Many thanks


  • Willr
    Forum Moderator
    5511 Posts

    Re: HELP!!! Rewrite on IIS 6 :( Link to this post

    Marc - what are the paths to your css being rewritten as in the html?

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.