Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Rewite Engine on Apache is rewriting direct file requests..

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
Go to End
Author Topic: 1147 Views
  • VipXonE
    Avatar
    Community Member
    3 Posts

    Rewite Engine on Apache is rewriting direct file requests.. Link to this post

    Apache/2.2.14 (Ubuntu) - 2.3.7/silverstripe_version
    In sapphire/main.php there is a comment that reads:

    * It's important that requests that point directly to a file aren't rewritten; otherwise, visitors
    * won't be able to download any CSS, JS, image files, or other downloads.
    *
    * On Apache, RewriteEngine can be used to do this.
    *
    * @package sapphire
    * @subpackage core
    * @see Director::direct()


    My server is doing exactly this. If I write in my domain name with no file name (e.g. www.myDomain.com) in the address bar my site works. If I write the domain plus a file name (e.g. www.myDomain.com/index.php) then I get the home page with no CSS, or Javascript etc. Using firebug I can see the some requests are messed up (e.g. http://assets, http://jsparty, http://sapphire).

    This came about because I recreated my site from an old backup after moving house and server. For some reason the original index.php was missing from all my backups except one.
    I am not sure if the index.php I eventually did find is the right one for my Silverstripe version (version: 2.3.7).

  • VipXonE
    Avatar
    Community Member
    3 Posts

    Re: Rewite Engine on Apache is rewriting direct file requests.. Link to this post

    http://mySite.com/index.php/admin
    Opens both Login page and then CMS with no Javascript and No CSS.

    http://mySite.com/admin
    Open both Login page and then CMS perfectly with no errors.

    I am right to say that the only error I am having is that index.php is NOT being removed when it is used?

    1147 Views
Page: 1
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.