Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » index.php added to base href

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

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

Page: 1 2
Go to End
Author Topic: 21094 Views
  • GibMo
    Avatar
    Community Member
    17 Posts

    Re: index.php added to base href Link to this post

    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.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: index.php added to base href Link to this post

    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

  • codem
    Avatar
    Community Member
    6 Posts

    Re: index.php added to base href Link to this post

    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!

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: index.php added to base href Link to this post

    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

    21094 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.