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   2611 Views

Avatar
Blake_NiteoDesign

Community Member, 17 Posts

6 July 2010 at 4:00am

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

Community Member, 712 Posts

7 July 2010 at 3:54pm

Is the machine running IIS or Apache?

Avatar
Sean

Forum Moderator, 922 Posts

13 July 2010 at 4:08pm

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

Community Member, 17 Posts

14 July 2010 at 4:01am

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

Community Member, 3 Posts

12 July 2011 at 2:38am

Edited: 12/07/2011 2:39am

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

Forum Moderator, 435 Posts

14 August 2011 at 8:54pm

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

Avatar
Terrence

Community Member, 2 Posts

24 December 2011 at 11:37am

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

Community Member, 5 Posts

18 July 2012 at 1:06pm

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>