Jump to:

4938 Posts in 16602 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Windows install fails due to .htaccess RewriteBase \

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: 3113 Views
  • fijiaaron
    Avatar
    Community Member
    3 Posts

    Windows install fails due to .htaccess RewriteBase \ Link to this post

    I've seen a lot of people with Windows installation problems. Just downloaded Silverstripe myself and ran into one, with a proposed fix. Is there an IRC channel or somewhere to talk with developers?

    Anyway, I'm installing with an existing Apache 2.2 on WindowXP, not WAMP. I'm using an Apache VirtualHost directive so the URL is:

    http://silverstripe.mysite.localhost instead of http://mysite.localhost/silverstripe

    It crashes Apache after writing the .htaccess file. On restart and reload of install.php I get an error message like:

    [alert] [client 127.0.0.1] C:/mysite/silverstripe/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context, referer: http://silverstripe.mysite.localhost/install.php

    The .htaccess file has the following line:

    RewriteBase \

    which I believe needs changed to:

    RewriteBase /

    In the install.php file I see the following:

    function createHtaccess() {
    $start = "### SILVERSTRIPE START ###\n";
    $end = "\n### SILVERSTRIPE END ###";
    $base = dirname($_SERVER['SCRIPT_NAME']);
    if($base != '.') $baseClause = "RewriteBase $base\n";
    else $baseClause = "";

    I think the problem is that Windows is returning a backslash for dirname(), where it needs a forwardslash. (see http://us.php.net/manual/en/function.dirname.php)

    I propose the following possible fix:

    $base = dirname($_SERVER['SCRIPT_NAME']);
    +++ if($base == '\') $base = '/';
    if($base != '.') $baseClause = "RewriteBase $base\n";
    else $baseClause = "";

  • fijiaaron
    Avatar
    Community Member
    3 Posts

    Re: Windows install fails due to .htaccess RewriteBase \ Link to this post

    Hmm... that doesn't seem to take care of the problem

    3113 Views
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.