Jump to:

22977 Posts in 11758 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » CSS not loading after moving silverstripe installation

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: 2046 Views
  • ssduduk
    Avatar
    Community Member
    8 Posts

    CSS not loading after moving silverstripe installation Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

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

  • ssduduk
    Avatar
    Community Member
    8 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

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

  • banal
    Avatar
    Community Member
    901 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

    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!

  • ssduduk
    Avatar
    Community Member
    8 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

    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?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

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

  • ssduduk
    Avatar
    Community Member
    8 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

    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 ?

  • ssduduk
    Avatar
    Community Member
    8 Posts

    Re: CSS not loading after moving silverstripe installation Link to this post

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

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