Jump to:

22993 Posts in 11829 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » "index.php" in url, if not, don't work

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2
Go to End
Author Topic: 4689 Views
  • __fabrice
    Avatar
    Community Member
    32 Posts

    "index.php" in url, if not, don't work Link to this post

    Hi,

    I've installed SilverStripe (lastest version) on Ubuntu 9.04.. All work fine, but.... in the url, I see that "index.php" need to be write. If not, the url rewriting is not "in action".
    For example, for the rebuild, this url is not valid : /relations_ships/db/rebuild?flush=1. I must add "index.php : /relations_ships/index.php/db/rebuild?flush=1

    I try to see in the .htaccess, but the file is like the original after installation. Is in the apache2 configuration ?

    thanks,
    Fabrice

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    Hi Fabrice,

    Would you please post the contents of your .htaccess file?

    Thanks,
    Ben

  • __fabrice
    Avatar
    Community Member
    32 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    Hi,

    Yes, this is :

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

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /silverstripe/relations_ships

    RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

    RewriteCond %{REQUEST_URI} ^(.*)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule (.*) sapphire/main.php?url=%1&%{QUERY_STRING} [L]
    </IfModule>
    ### SILVERSTRIPE END ###

    Thanks,
    Fabrice

  • banal
    Avatar
    Community Member
    901 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    Hi Fabrice

    Are you sure that mod_rewrite is enabled on your webserver, for the folder in question?
    AFAIK SilverStripe now also works without mod_rewrite (see this post: http://silverstripe.org/silverstripe-2-3-1rc1-released-testers-wanted/), and it seems the URL you're using is the one without rewrite!

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    Is your site mounted at http://your-domain-name/silverstripe/relations_ships or http://your-domain-name/relations_ships? If it's the latter, I think the RewriteBase directive (in .htaccess) should be "RewriteBase /relations_ships".

    Ben

  • __fabrice
    Avatar
    Community Member
    32 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    hi,

    Thanks for answers, but :

    - Yes, the module rewrite is actived :

    sudo a2enmod rewrite
    Module rewrite already enabled

    And in the .htacces, i must to write : RewriteBase /silverstripe/relations_ships 'cause the directories is that : /var/www/silverstripe/relations_ships

    Fabrice

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    Hum...there is a difference between having an Apache module installed and having it enabled. In your site's phpinfo() output, does the "Loaded Modules" section under one of the "apache" headings show "mod_rewrite"?

    Ben

  • __fabrice
    Avatar
    Community Member
    32 Posts

    Re: "index.php" in url, if not, don't work Link to this post

    hi,

    Yes, in the section named "apache2handler", I've "mod_rewrite" in "Loaded Modules"...

    Humm...

    Fabrice

    4689 Views
Page: 1 2
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.