-
Notifications
You must be signed in to change notification settings - Fork 934
How to install drupal to root directory, not /web? #258
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
Comments
Add |
Could this be added as a piece of configuration? This would allow people to use this composer project without having to adopt the project's opinionated file structure. For example, we are already putting our files in /web/public and not just /web if this directory structure where a part of configuration then we could use this project without forking/modifying all the places where this directory is used. |
Changing the composer.json is easy. But .gitignore and a few other files is not so easy. |
If it can be changed in one place it would be a non-issue. As it is, it is in 5 places just in the composer.json |
I am also not sure if the drush policy will still be enforced with a different folder structure. |
Replying to old questions but hopefully it helps someone in the future. Also, I believe this issue can be closed because there are simple fixes to both questions. @superfedya It is now best practice to have certain files outside of the root public directory. This is why many frameworks and CMS have a "web" or "public" or "pub" directory where the public files can live. A directory below that is where sensitive things like .git, private files and such can live. The simple way to deal with a /var/www/mysite.com/web is to edit your web server's document root. For example, in Apache this would mean setting DocumentRoot /var/www/mysite.com/web This should be easy even if you don't have access to your Apache or Nginx configuration files because changing the document root is a basic setting in shared hosting platforms like cPanel and Plesk. @frob the drupal-project allows you to specify different install paths if you don't like /web. You simple edit the extra.installers-paths section of the main composer.json. For example, if you prefer /web/public instead of /web then it would look like below
|
Also the drupal-launcher uses that installer-paths entry to find drupal root so it would be compatible with the above approach. |
Hi,
My site root directory is: /var/www/mysite.com
I installed composer via composer create-project drupal-composer/drupal-project:8.x-dev /var/www/mysite.com --stability dev --no-interaction
Everything works fine except that now my site address become mydomain.com/web/core/index.php instead of mydomain.com/index.php.
Any way to fix that?
Thanks
The text was updated successfully, but these errors were encountered: