Why do the Roots theme CSS files not load (404)?

I’ve set up my new shiny 3.5.1 WordPress using Git, following these instructions:
http://clintberry.com/2011/speed-up-your-wordpress-development-cycle-with-git/

(stopping after step 2; I’ve not created the child theme yet). I would expect the Roots theme to work by itself)

Read More

What I basically have is the same as the author’s Git project:
https://github.com/clintberry/WordPress

What I’ve ended up with is tags in the head section like:

<link rel="stylesheet" href="/assets/css/app.css">

I’ve checked in Chrome using the Web Inspector, and it tries to load

http://antonyh.co.uk/assets/css/app.css 

and returns a 404 file not found.

Why do these files not work?

Is there some magic I need to inject somewhere to make it load the CSS from the themes folder (which has roots/assets/css/app.css)?

I’ve not activated the theme yet, as I don’t want a broken site. I could fix this with rewrite rules but that somehow feels wrong. Any help or clues would be appreciated.

Related posts

Leave a Reply

1 comment

  1. I took a risk and activated the theme to see what might happen. Roots needs to complete theme activation to add the rules into .htaccess. Until this happens none of the CSS / JS will load and the theme preview lacks stylesheets.

    It turns the stock .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule .*.git/.* - [F]
    </IfModule>
    

    into something much longer, including

    RewriteRule ^assets/css/(.*) /wp-content/themes/roots/assets/css/$1 [QSA,L]
    RewriteRule ^assets/js/(.*) /wp-content/themes/roots/assets/js/$1 [QSA,L]
    RewriteRule ^assets/img/(.*) /wp-content/themes/roots/assets/img/$1 [QSA,L]
    RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
    

    It also adds the Boilerplate HTML .htaccess rules, and removed my .git rule; I’m going to add it back in for safety despite testing showing that the Git folders are not accessible.