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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

how do you remove /index.php/ from the urls?


Go to End


2 Posts   3128 Views

Avatar
otherjohn

Community Member, 125 Posts

5 May 2010 at 5:38am

Hi all,
I am using SS 2.4 r2 and just installed it with ease. I have this .htaccess file with it. What do I do to make friendly urls without the index.php in the url?
John

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

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

Avatar
otherjohn

Community Member, 125 Posts

5 May 2010 at 6:40am

handtyping the url without /index.php/ fixed it and its all working now.

What can I put in the .htaccess file to auto redirect it in case I have a rouge link out there?
John