Jump to:

4938 Posts in 16827 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » SS Installation on Windows Hosting, no css, mod_rewrite issue.

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: 2506 Views
  • Blake_NiteoDesign
    Avatar
    Community Member
    17 Posts

    SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    So, I have installed SS about 10 times now but they were all on LAMP machines. I was recently contracted to redesign a client's site and they are on a Windows-based host.

    I uploaded and installed as i normally would with only the "Can't tell whether mod rewrite's on" warning. It went well until installation was complete and upon going to the home page, the CSS is not being called properly.

    It is referring to css files located at www.xyz.com/index.php/themes/blackcandy/css/layout.css instead of www.xyz.com/themes/blackcandy/css/layout.css. I am sure it has to do with the mod_rewite but I am clueless as to how i should edit it as i am sure the .htaccess doesn't work on this package. I read elsewhere to look for a file called http.conf but i was unable to locate it anywhere in the host files.

    So before I ask my client to back up everything so we can switch to a LAMP package on the host, i just wanted to know if there was an easy way to fix this.

    Thanks!

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    Is the machine running IIS or Apache?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    On IIS 7.x you need to install IIS URL Rewrite and then run the SilverStripe 2.4 installer which will setup your web.config with rewrite rules.

  • Blake_NiteoDesign
    Avatar
    Community Member
    17 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    Thanks for the replies, guys.

    The hosting server was a shared IIS 6. The Support Team Member I was assigned made it pretty clear that I'd continue having issues with URL Rewrites if I stuck with the IIS 6 and that I should switch to LAMP and so, that's the route I chose.

    Thanks again!

  • Jennifer Banks
    Avatar
    Community Member
    3 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    I was having the same questions for windows hosting. Thank you for the replies, it was very helpful! I use http://www.serverintellect.com/ for my hosting.

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    For IIS6 there is a mod for htaccess. See on iis.net

  • Terrence
    Avatar
    Community Member
    2 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    Issue is with index.php
    There is a line where a string comparison is done without taking into account of the different separators for windows and linux.
    Change the following line
       $fileURL = (dirname($_SERVER['SCRIPT_NAME'])=='/'?'':dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url;
    to
       $fileURL = (dirname($_SERVER['SCRIPT_NAME'])==DIRECTORY_SEPARATOR?'':dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url;
    and that should solve your problem.

  • Kyudos
    Avatar
    Community Member
    5 Posts

    Re: SS Installation on Windows Hosting, no css, mod_rewrite issue. Link to this post

    I had this problem too, so for the sake of completeness, the missing rules from web.config are:

    <rewrite>
    <rules>
    <clear />
    <rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
    <conditions logicalGrouping="MatchAll">
    <add input="{REMOTE_ADDR}" negate="true" pattern="127.0.0.1" />
    <add input="{URL}" pattern="*.ss" />
    </conditions>
    <action type="CustomResponse" statusCode="403" />
    </rule>
    <rule name="SilverStripe Clean URLs" stopProcessing="true">
    <match url="^(.*)$" />
    <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    </conditions>
    <action type="Rewrite" url="sapphire/main.php?url={R:1}" appendQueryString="true" />
    </rule>
    </rules>
    </rewrite>

    2506 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.