Sage & Bedrock without Trellis

Hi,

I was just curious about using Sage/ Bedrock but with a standard ftp or grunt-wordpress-deploy to deploy.

My concern is the different folder structure of Bedrock. For example if I were to upload Bedrock Wordpress install with a Sage them would it work “out of the box” or would I have to edit my remote host in anyway?

Basically does Bedrock automatically point the webroot to /web and therefore the themes index.php within the folder structure?

No, not when you’re using a shared webhosting.
Although it’s not recommended, you can add this to your .htaccess file in your root:

#  Change root directory to "web" folder
RewriteEngine on
RewriteCond %{THE_REQUEST} ^GET\ /web/
RewriteRule ^web/(.*) /$1 [L,R=301]
RewriteRule !^web/ web%{REQUEST_URI} [L]

Which will make your Bedrock installation work.

1 Like

Thank you - this really helped me…

Can I ask why this method isn’t recommended, and what the the alternatives are?

As I suspected…

So if my understanding is correct you require a host with full root access in order to change webroot of vhost?

As asked by leaf why is using htaccess to change web root not recommended?

Last question, are there any in depth guides for novices to configure a bedrock / trellis deployment environment? Doesn’t seem to be much on the web

If there is a public directory and you have access to the folder above it, as many hosts provide a public_html or similar folder for your site, you can change the web folder to the name of the public folder and set up your project that way. I used to use Bedrock for plenty of sites on Rackspace Cloud Sites :poop: and I changed web to content

You’re making a redirect for every single thing on your site. I would assume this affects performance, and also sounds very brittle.

I can understand people’s hesitation with using something like Digital Ocean and their own VPS, but getting Trellis set up does take care of so much of the work, you shouldn’t need to do much configuration. However, just like basically every Roots project, being comfortable with the command line and not being afraid to do some of your own debugging and experimenting does help immensely.

For Bedrock there are the docs, there is a screencast, and I believe I’ve seen some tutorials posted on the web as well.

Trellis is newer so outside of the docs a lot of user experience and debugging will be found right here on https://discourse.roots.io . Scott’s hoping to have a more in depth screencast out eventually.

And of course, if there are issues with the documentation, let us know so we can make updates, we don’t intentionally make it difficult for users to get started, but we don’t know every hardship that people have unless they post it. And also at the same time, Roots is about using modern web development tools, and we all do this in our spare time, so we’re unable to write multiple in-depth tutorials for every use case yet. Perhaps one day :wink:

2 Likes

Hi Kalen,

I do indeed have a shared server with my webroot being public_html. However I am looking to move to a cloud based VPS or even Amazon Web Services.

Completely agree with reasons for not using htaccess so that’s ruled that out. I will maybe play around with changing web folder to public html and see how that goes, however I am looking to use the full potential of Bedrock / Trellis. Using FTP is such a laborious task and makes it seem when developing Wordpress sites that i’m going back in time!

Understand regarding docs, I would of expected to see cases of others using it but find little to know information on S Overflow / Youtube.

Determined to crack this, my local environment install of Bedrock works like a charm, coupled with Sage as a theme it really does live up to it’s claim of “modernising wp development”. Seem I have this final hurdle to cross… just waiting for that glorious Ureka moment.

Just to clarify, I have no issues installing Bedrock on a local environment, it is the deployment phase that is giving me trouble

Give me a shout if you would like to work on this together, knowledge is always best when shared!

Ah that’s good to know!
In that case you should also move the .env file and config & vendor directories one level up right?
And change the /web instances in the application.php file. Anything else I am suppose to change?

Thanks!

Hi james can you help me out with my problem in deploying bedrock in my local server to my live site? I’m using windows OS.