Getting the hang of symlink or redirect to web folder?

Im playing around with Bedrock with the purpose of using it for all future projects.
The whole setup and capistrano production deployments work flawless… But.
I just cant seem to figure out the mystery of either setting the vhost to the right directory or setup symlink right.

Ive tried changing apache vhost config to path/shared/web like this:

DocumentRoot /var/www/html/shared/web
<Directory "/var/www/html/shared/web">
  Options FollowSymLinks
  AllowOverride All
</Directory>

But that doesnt have any affect - its still just a blank screen. Ive checked and the db connection and im not getting any errors there.
I’ve also changed the deploy.rb to

set :linked_files, fetch(:linked_files, []).push('.env', 'web/.htaccess')

and created a htaccess file within shared/web:

    # 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]
    </IfModule>
    # END WordPress

The root needs to be current/web, not shared/web

1 Like

Thanks @benword - that makes sense :smile:
The htaccess file should be in shared/web right? Can you briefly explain what the shared folder is for by the way?

shared/ is just a place to keep things that don’t belong to a specific deploy, they need to exist “outside” of them. User uploads are the perfect example so you want them to persist across deploys and not have them cleared each time. So yes, .htaccess belongs there if its not in your repo.

1 Like