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.

Installing SilverStripe

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

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

SS Installation on Windows Hosting, no css, mod_rewrite issue.


Reply

8 Posts   2522 Views

Avatar
Blake_NiteoDesign

6 July 2010 at 4:00am Community Member, 17 Posts

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!

Avatar
Hamish

7 July 2010 at 3:54pm Community Member, 712 Posts

Is the machine running IIS or Apache?

Avatar
Sean

13 July 2010 at 4:08pm Forum Moderator, 921 Posts

On IIS 7.x you need to install [url=http://www.iis.net/download/URLRewrite]IIS URL Rewrite[/url] and then run the SilverStripe 2.4 installer which will setup your web.config with rewrite rules.

Avatar
Blake_NiteoDesign

14 July 2010 at 4:01am Community Member, 17 Posts

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!

Avatar
Jennifer Banks

12 July 2011 at 2:38am (Last edited: 12 July 2011 2:39am), Community Member, 3 Posts

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

Avatar
biapar

14 August 2011 at 8:54pm Forum Moderator, 435 Posts

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

Avatar
Terrence

24 December 2011 at 11:37am Community Member, 2 Posts

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.

Avatar
Kyudos

18 July 2012 at 1:06pm Community Member, 5 Posts

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>