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.

General Questions

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

Rewite Engine on Apache is rewriting direct file requests..


2 Posts   1153 Views


2 January 2011 at 4:04am (Last edited: 2 January 2011 4:53am), Community Member, 3 Posts

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. in the address bar my site works. If I write the domain plus a file name (e.g. 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).


2 January 2011 at 5:30am Community Member, 3 Posts
Opens both Login page and then CMS with no Javascript and No CSS.
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?