Jump to:

23472 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » website.com/index.php to website.com

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
Go to End
Author Topic: 5517 Views
  • wonnepfropfen
    Avatar
    Community Member
    18 Posts

    website.com/index.php to website.com Link to this post

    Hello

    I'm using Silverstripe 3.

    Would anyone know how my htaccess has to look like, so that mod_rewrite is active. I want to get rid of the index.php within the URL. And if I just copy the htaccess text of an older version of Silverstripe the page is not displayed anymore.

    Would anyone able to help me.

    Thank you.

    I tried using this:

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

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

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

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

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: website.com/index.php to website.com Link to this post

    Hi,

    It's probably an issue that the server you are using doesn't have it rather than the .htaccess file is faulty (assuming you are using the default). Are you on the localhost?

  • wonnepfropfen
    Avatar
    Community Member
    18 Posts

    Re: website.com/index.php to website.com Link to this post

    Hello Swaiba

    Thanks for your reply!

    I've first asked my provider and they told me it's an issue of Silverstripe. So I've had a look at the config-file and htaccess, but I don't know what to change in order to get rid off the "index.php" within the URL. I think another issue that occurs because of that, is that the preview of the backend won't work.

    Right now my .htaccess is empty. What would be the default content of the htaccess? Maybe would help already.

    Thanks for your help!

  • camfindlay
    Avatar
    Forum Moderator
    148 Posts

    Re: website.com/index.php to website.com Link to this post

    If you are using SilverStripe 3 then your code in the the htaccess file above is incorrect (note the reference to 'sapphire'? this was what our framework was called back in version 2).

    To get the new SilverStripe 3.1 version you can look at the SilverStripe base files at https://github.com/silverstripe/silverstripe-installer

    Also please note, I'm going to change the title of your thread I it seems we are being indexed for adult entertainment websites!

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