Jump to:

4952 Posts in 14389 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » [Resolved] 301 Problem with New Install

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: 548 Views
  • Kyudos
    Avatar
    Community Member
    5 Posts

    [Resolved] 301 Problem with New Install Link to this post

    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

  • Kyudos
    Avatar
    Community Member
    5 Posts

    Re: [Resolved] 301 Problem with New Install Link to this post

    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?

  • Kyudos
    Avatar
    Community Member
    5 Posts

    Re: [Resolved] 301 Problem with New Install Link to this post

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

  • Kyudos
    Avatar
    Community Member
    5 Posts

    Re: [Resolved] 301 Problem with New Install Link to this post

    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>

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