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, Ed, biapar, Willr, Ingo, swaiba

Rewite Engine on Apache is rewriting direct file requests..

Go to End

2 Posts   1495 Views


Community Member, 3 Posts

2 January 2011 at 4:04am

Edited: 02/01/2011 4:53am

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).


Community Member, 3 Posts

2 January 2011 at 5:30am
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?