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.

Installing SilverStripe /

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

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

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


Reply


2 Posts   2491 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