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

index.php added to base href


Go to End


12 Posts   26198 Views

Avatar
GibMo

Community Member, 17 Posts

11 October 2010 at 9:21am

Ok txz Simon,

Is renaming the index.php a real solution or should I contact my host? In other words can it cause any problems using a different name for the index.php.

Avatar
Sean

Forum Moderator, 922 Posts

11 October 2010 at 10:30am

Edited: 11/10/2010 10:30am

The index.php is only provided as a fallback for cases when mod_rewrite isn't enabled.

Deleting it is safe, along with install.php, once you've successfully installed SilverStripe.

Cheers,
Sean

Avatar
codem

Community Member, 6 Posts

12 October 2010 at 12:34am

Hi

I had this problem with a site - all the links based off / but on the homepage, inexplicably, the links were based off /index.php.

Rather than deleting files or hacking core code - I added this to _config.php:

<code>
Director::setBaseURL('/');
</code>

Which fixes the issue (for me) as it overrides the internal base url handler and forces it to use / - obviously when you force stuff it may not work in edge cases.

Thanks!

Avatar
DsX

Community Member, 178 Posts

13 October 2010 at 4:33am

Thanks civkati
that solved my problem :)
as well this fixed an issue I had with debuggin in my IDE, where I needed to specifiy a start page for loading the site in debug mode. The only page I could specify to use for this was index.php, but linking to it directly cause all of the path errors I listed earlier. So this has made it so that I can now run local debuggin in my IDE :)

Go to Top