Helloo, I just ran into this within the last few days. I was running SS 2.4.5 with no problems for a year. GoDaddy just updated Apache on my hosting server. I only have an Economy account with shared server space. Since then, Silverstripe has gone haywire and started adding /index.php/ to all my URLs. The first thing I did was backup everything and do an in place upgrade to 3.0.5. After running the dev/build?flush=1 the database rebuilt successfully. I still had the same problem. Browsing to www.sitename.com/ redirected me to www.sitename.com/index.php/welcome. This produced the generic page not found error. I setup a subdomain called testingsite and extracted a new copy of SS 3.0.5. Made a new database and performed the install. During the install I received a warning saying to have your web admin check the apache config and enable mod_rewrite..... I verified mod_rewrite is working correctly by adding "RewriteRule .* http://www.silverstripe.org [R=301,NC,L]" to my .htaccess. this redirect worked correctly. So I came to the conclusion that SS mod_rewrite autodetection needs a little patching to support the latest apache release. I will get version numbers later. The simplist fix is to make the adjustment in your .htaccess file. Here is what I modified mine too. Thanks go out to stanis.net for the fix.
### 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>
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html
<IfModule mod_alias.c>
RedirectMatch 403 /silverstripe-cache(/|$)
RedirectMatch 403 /vendor(/|$)
RedirectMatch 403 /composer\.(json|lock)
</IfModule>
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php/(.*)$ /$1 [R=301,L]
RewriteRule index\.php / [R=301,L]
# RewriteRule .* http://www.silverstripe.org [R=301,NC,L]
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.php$
RewriteRule .* framework/main.php?url=%1 [QSA]
RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . %1/install.php? [R,L]
</IfModule>
### SILVERSTRIPE END ###
By adding the following:
RewriteRule ^index\.php/(.*)$ /$1 [R=301,L]
RewriteRule index\.php / [R=301,L]
you can force the removal of index.php. This is working perfectly for me now. All pages load correctly. Hopefully in the future SS autodetection will be working correctly. Hope this helps.