Bedrock + Sage - wp = Wrong path for assets

Hi guys,

I’m currently using bedrock + sage starter theme and my bedrock setup goes without a subfolder, like this:

.env file



  DocumentRoot ~/bedrock/web/wp/
  <Directory ~/bedrock/web/wp/>

The thing is, my assets are in /app/themes/sage/assets/ which is a folder before /wp/ which I don’t want to show. Is there a way to make this work?

Thanks in advance

  DocumentRoot ~/bedrock/web/
  <Directory ~/bedrock/web/>

And me thinking that would make /wp/ folder explicit in url. That solved it correctly. Thanks @austin :sweat_smile:

EDIT: That actually breaks wp-admin unfortunatelly. Any other idea @austin? I just want to not show /wp/ in my url. My production server has nginx and locally is apache. Both gives the same error.

Access it via /wp/wp-admin

Here is a working nginx config to put in your sites-enabled

server {
  set $site_name;

  listen *:80;
  access_log   /srv/www/;
  error_log    /srv/www/;

  root  /srv/www/;
  index index.php;

  charset utf-8;
  include wordpress.conf;

server {
  listen *:80;
  return 301 $scheme://$request_uri;

and wordpress.conf:

location / {
  try_files $uri $uri/ /index.php?$args;

location ~ \.php$ {
  try_files $uri =404;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  fastcgi_pass unix:/var/run/php5-fpm-$site_name.sock;
  client_max_body_size 0;

This is assuming you are using a style PHP setup

Say this out loud to yourself a couple times and perhaps you will become aware of the trouble this can cause :stuck_out_tongue:. Don’t do this.

Also here is my .env file:


I know it’s not ideal, but working in OSX with nginx seems a lot of trouble too. The better way here would be VMing the whole thing (Vagrant, I’m going to try soon) but since I don’t have this choice right now, this is what I can do.

I know I won’t be using any .htaccess stuff for now. This nginx setup is what I’m using, almost exactly.

Having said that, folder /wp/wp-admin gives me 404. You can see it live at (the difference here is that .env is, of course, in both wp_home and wp_siteurl). Like I said, nginx setup is almost identical (with some extras about 404).

EDIT: I’m sorry @austin, your answer came after I sent this reply. Your setup works for nginx successfully. Is there any case in apache? I’ll try 30min of this, if not I’m gonna brew install nginx here too.

Definitely recommend using bedrock-ansible for local dev. It’s incredibly easy. Way easier than messing with OSX. Those configs I posted come from it anyway.

I’ve just installed nginx here, just for my sanity. It’s working, but I’m going to check ansible too. The idea of running a VM on top of so much optimization seems so wrong but hell, the sanity of same environments pays it off.