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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

website.com/index.php to website.com


Go to End


4 Posts   6658 Views

Avatar
wonnepfropfen

Community Member, 18 Posts

27 April 2013 at 7:38am

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

Avatar
swaiba

Forum Moderator, 1899 Posts

28 April 2013 at 12:42am

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?

Avatar
wonnepfropfen

Community Member, 18 Posts

28 April 2013 at 2:19am

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!

Avatar
camfindlay

Forum Moderator, 267 Posts

18 May 2014 at 10:23pm

Edited: 18/05/2014 10:24pm

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!