Here is what worked for me, but I'm on site5, so the contents of your htaccess file will probably be different; At the bottom of my deploy.rb file, I added the following:
after "deploy:create_symlink", "MYAPPNAME:htaccess_setup"
namespace :MYAPPNAME do
task :htaccess_setup, :roles => :app do
htaccess = "PATHTOMYPUBLICDIR/.htaccess"
run "if [ ! -f #{htaccess} ]; then echo 'PassengerEnabled On' > #{htaccess}; echo 'PassengerAppRoot #{current_path}' >> #{htaccess}; echo '.htaccess created'; else echo '.htaccess already exists (untouched)'; fi"
end
end
source
share