Short path rewrites not working with Roots + Bedrock [resolved]

Just been getting up to speed with the ace Bedrock framework. I’ve managed to happily add a few plugins, get SASS going in Grunt - it’s all good.

However, I’m having a problem with the asset paths. The generated CSS link is:

<link rel="stylesheet" href="/wp/wp-content/themes//theme-name/assets/css/main.min.css?ver=0940f08fdc917bddc53b9d37da9514f7">

This is obviously a bit messier than it should be.

If I do something like this:

wp_enqueue_style( 'custom-stylesheet', get_template_directory_uri().'/assets/css/custom-stylesheet.css' );

it comes out more like this:

<link rel="stylesheet" href="">

The .htaccess file in my project/web/ folder is as follows:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

So, ideally I’d have the nice short URLs that Bedrock & Roots promised, but if I can’t have those working, then at least I’d like the normal WP urls back.

Any custom themes should be in app/themes/ instead of wp/wp-content/ (you should never modify anything in there since it’s managed by Composer). With your theme in the correct place, your asset paths would look like:


You could shorten that using something like the but with Bedrock we just recommend keeping it as the default since /app/themes/name/assets is nice enough to use now.

edit: you’re also getting a double slash // you should fix. Make sure there’s no trailing slashes in your WP_HOME or WP_SITEURL.

edit again: Just fixed the double slash bug which was our fault:

Brilliant! Thank you, simply moving the theme to app/themes has solved it. As you might expect, the double slashes went away then too.