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

CSS not loading after moving silverstripe installation


Go to End
Reply

11 Posts   2238 Views

Avatar
ssduduk

13 September 2009 at 4:19am Community Member, 8 Posts

I did a bad thing.
I installed silverstripe in /var/www/silverstripe and it worked great.
But then i moved the installation in /var/www
That's when css files stopped loading.

This is what the error log says:
File does not exist: /var/www/silverstripe

How do i fix this?

Avatar
Willr

13 September 2009 at 9:55am Forum Moderator, 5511 Posts

check the .htaccess file in /var/www/. The silverstripe path could have been hardcoded into that.

Avatar
ssduduk

13 September 2009 at 11:28pm Community Member, 8 Posts

Sadly, there is no .htaccess file in /var/www....
Now what?

Avatar
banal

13 September 2009 at 11:55pm Community Member, 901 Posts

The .htaccess file should be there or it's still in /var/www/silverstripe and you didn't move it. There's usually a .htaccess file involved with a SilverStripe site...
On *nix systems, files that start with a dot (.) are usually hidden. Make sure that these hidden files are also shown to you!

Avatar
ssduduk

14 September 2009 at 8:34pm Community Member, 8 Posts

I know how to see hidden files, i even did a find, and it found a few, but not in /var/www (there were some in the subfolders though).
I am guessing that when i did the move, it did not move the hidden files.
I deleted the silverstripe subfolder though.
What is the next step, do i reinstall?

Avatar
banal

14 September 2009 at 9:57pm Community Member, 901 Posts

Just create a new .htaccess file and put in the following code

### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###

Make sure to change the RewriteBase if needed...

Avatar
ssduduk

15 September 2009 at 3:02am Community Member, 8 Posts

I created the file, but no change. Can you elaborate what should stand in RewriteBase?
Since silverstripe is sitting in /var/www which is the root folder it should remain / as it is?
Or am i mistaken, and should put /var/www ?

Avatar
ssduduk

15 September 2009 at 3:11am Community Member, 8 Posts

Just tried both, nothing works.
Now what?
Do you need any additional info?

Go to Top