Skip to content

Instantly share code, notes, and snippets.

Last active Oct 1, 2018
What would you like to do?
Deploy WordPress (Bedrock) with Capistrano to a Shared Host (Bluehost). See
RewriteEngine on
#change to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteCond %{REQUEST_URI} !^/current/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /current/web/$1
#change to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ current/web/index.php [L]
set :application, ''
set :repo_url, ''
set :branch, :master
set :deploy_to, -> { "/home2/whatever/public_html/#{fetch(:application)}" }
set :log_level, :debug
set :linked_files, %w{.env web/.htaccess}
set :linked_dirs, %w{web/app/uploads}
set :tmp_dir, "/home2/whatever/capistrano_tmp"
SSHKit.config.command_map[:bash] = "/usr/bin/bash"
SSHKit.config.command_map[:composer] = "php-cli /home2/whatever/composer.phar"
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :service, :nginx, :reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment