New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better webroot structure (web/) #32
Conversation
What about |
@lautreamont3 thanks, fixed! |
You did not change |
@lautreamont3 wow only saw your comment about uploads... actually fixed now. |
I am not shure, because I constantly change my vagrant/apache configuration, but I don't think this is configuration error. So I think you need to add this #ADDITION to
This will satisfy BECAUSE YOU ONLY READ END OF MESSAGES I SPLIT THIS TO POINT SEPARATE TEXTS I have one question my configuration don't work if I leave
in web/wp-config.php, I must use absolute path or I get error
am I doing something wrong? |
I came across the same issues with To solve the first issue with
As for the Adding the full file path to the
Note: Both workarounds worked for me, however, I'm not sure if that would be the most elegant solution. Even though I've developed my first WordPress website by being inspired by the Roots theme a few years ago, I'm still only a beginner to the whole new concept of Modern Wordpress Development Workflow. |
Sorry guys, I've just been doing this PR manually without testing it (not a good idea btw). Just opened the PR a bit early, but you're both right. @rslnk there's nothing wrong with your solution. Requiring absolute vs relative paths isn't really less elegant. Probably better in the long run and using |
No problemo, with this changes everything works like standard Bedrock. @rslnk Dont forget |
@rslnk squashed all your commits into 1 but all the work is still there :) |
Correct .gitignore
to
|
@@ -22,8 +22,9 @@ | |||
/** | |||
* Custom Content Directory | |||
*/ | |||
define('APP_ROOT', $root_dir . '/web'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename APP_ROOT
to WEB_ROOT
to avoid confusion with the content dir that is named app, also as said in the pull request description its commonly referred as webroot; maybe also move this constant up near $root_dir
definition since this section is about custom content dir, just my 2 cents ;)
anyway good PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Just did those changes since they makes sense.
Better webroot structure (web/)
What's the best to way to have "htdocs" instead of "web" dir? Do I have to fork your repo and modify it on my own? |
yep. |
Wow, that's fast. do you think it's good to update the README with the new web path for my fork? And leave you and Scott as authors in the composer file? Sorry for this questions, but I'm new to this :/ |
You could also use a symlink for htdocs to the web directory if that option is avail to you. |
@studio4s I probably wouldn't worry about updating anything else. Not really important in the long run. |
Running
Specifying |
@swalkinshaw that you so much Scott!!! |
Better webroot structure (web/)
Bedrock currently exposes a lot of files to the webroot that shouldn't be there. The README provides some web server configs to block access to these files, but it's still not a proper solution.
This PR moves what's required into a
web/
directory including the vendor'd WP source, and the app source itself. Now an Apache/Nginx site should be pointed to/path/to/site/web/
instead of just/path/to/site/
The name
web
was chosen since it reflects that its thewebroot
.public
is a very common name in frameworks like Symfony, Rails, Laravel etc, but it doesn't directly map to our use case since that's always for static file serving like images, scripts, css etc.See #10 for more discussion.