Jump to:

4952 Posts in 14282 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Curse of the dreaded 'Friendly URL's' ... ?

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: 815 Views
  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    Hi, really hoping someone can help. I've been working on this issue for well over a week now with not so much a smidgeon of luck, and I'm now seriously behind schedule and in danger of losing a client. I've searched and searched and searched and tried everything I've come across and nothing is helping at all.

    The problem stands thusly:
    Fresh install of SS 3.1.2 ... home page (and all other pages) come up with 'page not found' unless /index.php is added to the url.

    Themes ARE working ... in the source code they're linked correctly without '/index.php/' in the link, so friendly url's must be at least PARTIALLY working right??? (though I have

    Director::setBaseURL('/');

    in the config.php - prior to adding that the themes were working on the home page but NOT on homepage.com/index.php/ but since adding that they work there too)

    I tried flushing the cache but when I add ?flush=1 or ?flush=all it asks me to log in and when I enter login credentials it then comes up with

    Action 'eurl.axd' isn't available on class MemberLoginForm.

    Server is windows hosted with kiwihosting.net
    I have about 8 other sites build with various version of SS on the same server and they all work fine, so the server environment must be sufficient.

    There is a silverstripe-cache folder in the root directory.

    I've had problems similar in the past that led back to issues with .htaccess but I've checked the .htaccess file against all other I have on the same server and as far as I can tell it seems fine (I'm not terribly great with all this stuff... I'm but a lowly visual designer with a general knack for figuring out how to solve technical issues ... usually)

    I'm really tired and stressed now and cannot remember what other vital information might be needed in order to solve this problem but I hope someone can please please please please help ....

    Oh ... and my .htaccess file looks like this:

    ### SILVERSTRIPE START ###
    <Files *.ss>
       Order deny,allow
       Deny from all
       Allow from 127.0.0.1
    </files>

    <Files web.config>
       Order deny/allow
       Deny from all
    </Files>

    ErrorDocument 404 /assets/error-404.html
    ErrorDocument500 /assets/error-500.html

    <IfModule mod_alias.c>
       RedirectMatch 403 /silverstripe-cache(/|$)
       RedirectMatch 403 /vendor(/|$)
       RedirectMatch 403 /composer\.(json|lock)
    </IfModule>

    <IfModule mod_rewrite.c>
       SetEnv HTTP_MOD_REWRITE On
       RewriteEngine On

       RewriteCond %{REQUEST_URI} ^(.*)$
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_URI} !\.php$
       RewriteRule .* framework/main.php?url=%1 [QSA]

       RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule . %1/install.php? [R,L]

    </IfModule>
    ### SILVERSTRIPE END ###

  • Matt
    Avatar
    Core Development Team
    84 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    Hi Scorpiankh,

    When you say Windows hosting, do you mean Apache on Windows, or IIS on Windows? The eurl.axd error seems to bring back errors regarding IIS.

    edit: I should mention that if you are using IIS, then changing the .htaccess rules won't do anything as they are only for Apache. You'd need to change the web.config file for IIS to pick up on rule changes.

  • camfindlay
    Avatar
    Forum Moderator
    148 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    Can you let us know if it is running on IIS (Windows web server) or Apache (open source web server). The answer to your question will be different depending on the type of technology you are on.

    If you are on IIS the .htaccess file will have no effect as that is only for apache.

    If you are on apache 2.2 you'll need to ensure in the httpd.conf file that "AllowOverride All" is set.

    If you are on Apache 2.4 you need to add a little more to the httpd.conf file -> see this forum post with the fix there: http://www.silverstripe.org/installing-silverstripe/show/17923?start=8

    Hope that points you in the right direction.

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    Well that would make sense then, I'm pretty sure the webhosts servers run on IIS ...
    What would I need to change in the web.config?

  • camfindlay
    Avatar
    Forum Moderator
    148 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    I'm not an IIS user unfortunately (I keep things open source) but you might find some information here http://doc.silverstripe.org/framework/en/installation/windows-manual-iis-7 around the friendly URL setup under IIS (note that is for IIS7 it's going to depend on what you have).

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    Hi
    Thanks for the reply. I had a look through the info on that link but that all seems to point to server-side settings etc, which I don't have access to. I've emailed the webhosts to see if they can help or shed some light on the situation but don't expect a reply from them anytime soon, they're a bit slow.
    Given that I already have a half dozen other SIlverStripe websites running on the same server though, I would think that would be an indication that the server settings are sufficient to what is needed for SS to work properly?

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    I heard back from the webservers, they confirmed that yes they do use IIS, but also said that .htaccess should still work on their servers.
    Then they went and had a look and came back to me with "Well, we can't find anything that would be causing the problem at our end, and we had a look at the website and it's working fine with no 'page cannot be found' errors"
    At which point I went back and had a look to find that yes, suddenly the site is miraculously working exactly as it should.
    Would have been nice to have known what the problem was, but oh well. Long as it's working.

    Thanks for the replies and help anyways

  • camfindlay
    Avatar
    Forum Moderator
    148 Posts

    Re: Curse of the dreaded 'Friendly URL's' ... ? Link to this post

    No problem, hope the project comes out well. Post up a link on twitter or somewhere once your project is live

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