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

[Resolved] 301 Problem with New Install


Reply

4 Posts   576 Views

Avatar
Kyudos

17 July 2012 at 8:31pm Community Member, 5 Posts

A design / branding agency developed a SS theme / template for us, which I'm trying to get going on our (IIS) webserver so we can start adding real content.

(The webserver was already running PHP and MySQL).

I unzipped the SS content in a new folder under wwwroot, created the MySQL database and imported the tables from an SQL export file. I created a new web site in IIS, pointing to the new folder, set the default document to index.php, so far so straightforward.

When I navigate to to the new site (say http://10.0.0.1/) the whole thing stuggles mightily, I don't see any SS theme just the raw conntent and logs show me a whole bunch of 301 errors for various SS files (like CSS etc.)

However, if I create a virtual folder on the site and point it to the same location with an alias (e.g. sssite), then navigate to that location (say http://10.0.0.1/sssite/), it all appears to work as intended.

Is there some config somewhere that might be causing the 301s?

Cheers

Avatar
Kyudos

18 July 2012 at 11:54am Community Member, 5 Posts

Looking at this again with my head on straight this morning, I can see that the 301 comes from attempts to locate stuff like:

/index.php/sapphire/thirdparty/jquery/jquery.js

Suggesting, perhaps, that the URL rewriting needs some work. How does one set that up for IIS?

Avatar
Kyudos

18 July 2012 at 12:23pm Community Member, 5 Posts

Ok bizzareness - I guess I don't really understand what PHP is doing with the non-.htaccess rewriting.

Looking at the source of the pages that do work vs the same page when it doesn't work, I see it filled with things like:

DOESN'T WORK:
<link rel="stylesheet" type="text/css" href="http://10.0.0.1/index.php/themes/mytheme/css/form.css?m=1341875218" />

DOES WORK:
<link rel="stylesheet" type="text/css" href="http://10.0.0.1/sssite/index.php/themes/mytheme/css/form.css?m=1341875218" />

To me, they both seem like incorrectly formed hrefs (with a file name in there?)

Avatar
Kyudos

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

Following on from this:

http://www.silverstripe.org/installing-silverstripe/show/14207

I found it WAS a rewrite problem, I was mising the following rules from web.config:

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