Blog » Installing Silverstripe on

Installing Silverstripe on

Following up from one of the previous blog posts, I have deleted all the extra rewrite rules from the .htaccess file, and the CMS operates perfectly. So, here are the installation instructions for anyone wishing to use Silverstripe with These instructions may also solve problems on other hosts.

IMPORTANT: These instructions are for Kiwihosting's HSphere based Unix servers only. See this blog entry if you are installing on their newer Helm based Windows servers (2009/01/05).

Installation Instructions

Download the latest Silverstripe archive and decompress it to a directory. Open up sapphire/main.php, and search for the following line:

    $baseURL = dirname(dirname(dirname(dirname($_SERVER['SCRIPT_NAME']))));

Replace this line with:

    $baseURL = "/"; 

In version 2.2.2, this is at line 149. Upload the Silverstripe files to the server as per normal installation. Next, create a new .htaccess file containing the following:

    php_flag zend.ze1_compatibility_mode Off
php_value allow_call_time_pass_reference on
php_value register_globals off

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_URI} !(/awstats/*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /sapphire/main.php?url=%1&%{QUERY_STRING} [L]

Upload this .htaccess file to the root directory of the server. Next, complete the standard installation procedure. The server may complain that mod-rewrite is not working; this is okay. At this point, you may need to upload the .htaccess file again, because the installer may change it.

Download the file mysite/_config.php (via FTP). Add the following line:


Now upload mysite/_config.php back to the server. Silverstripe should now be installed, and work correctly.

Blog » Installing Silverstripe on

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments

Blog » Installing Silverstripe on