Skip to content

Ability to disable/ modify ddev start docroot index.* check #7345

Closed

Description

@n8-dev

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

Changes present in #7228 now on every DDEV start output the following warning for our projects.

The index.php or index.html does not yet exist in ...

The project type is silverstripe and aiming to run on the Silverstripe Cloud hosting platform.

The official Silverstripe Cloud hosting platform uses the webroot as the docroot, which uses an .htaccess rule to rewrite the request to the public/ dir where the index.php file lives. This means any project that wants to match the official hosting setup will have this warning on every ddev start even though there is a valid index.php file.

It would be great to not have this warning.

Specific code:
https://github.com/ddev/ddev/pull/7228/files#diff-de9be5de8b21f6465a7e0df5c9c2f44638c0a67659ccf812cd043bfee94aeeb1R1787

Describe your solution

Ability via the .ddev/config.yaml to bypass this check.
docroot_index_check: false or something

Describe alternatives

Perhaps an "extension" point to allow project types to override this before the final check.
I'd assume various types of things would possibly have some subtle differences, and this would allow some flexibility there.

Additional context

No response

Activity

  1. changed the title [-]Ability to disable/ modify `ddev start` root index.* check[/-] [+]Ability to disable/ modify `ddev start` docroot index.* check[/+] on May 29, 2025
  2. ChloeSartorelli commented on May 29, 2025

    @ChloeSartorelli
    Contributor

    Perhaps an "extension" point to allow project types to override this before the final check.

    I don't think the project type should change it here, as having public/ as the docroot is more technically correct for Silverstripe CMS projects - that just unfortunately (as you pointed out) doesn't match up with how it's set up in the official hosting platform. So anyone wanting to match that hosting environment must use the less technically correct but more situationally appropriate docroot ./

    I think the option to disable the warning via .ddev/config.yaml is appropriate.

  3. ChloeSartorelli commented on May 29, 2025

    @ChloeSartorelli
    Contributor

    The other alternative (which would be very user friendly but probably more effort than it's worth) could be to parse .htaccess to look for rewrite rules, and take them into account if the webserver type is apache.

    I don't think that should be done, but adding it as an alternative for completeness' sake.

  4. ChloeSartorelli commented on May 29, 2025

    @ChloeSartorelli
    Contributor

    Note that there are likely also other valid reasons to want to suppress this warning, for example someone developing a CLI application won't have an index.php file.
    I know DDEV is primarily intended to be used for web development but that's not all it's good for, and where a light-touch change can improve that use case I think that's valuable.

  5. stasadev commented on May 30, 2025

    @stasadev
    Member

    @n8-dev,

    We check for any index.* file in the docroot. If the warning is annoying, you can create a dummy index.whatever file in the docroot, commit it or add it to .gitignore, and the warning will stop.

    It would be great to not have this warning.

    It's understandable, but it's just a warning. We added it because of frequent support requests about 403 errors. Therefore, from our point of view, it is better to have it.

    Ability via the .ddev/config.yaml to bypass this check.
    docroot_index_check: false or something

    No, adding more small options like this would be a maintenance burden. We already have too many config options: https://ddev.readthedocs.io/en/stable/users/configuration/config/


    @GuySartorelli,

    The other alternative (which would be very user friendly but probably more effort than it's worth) could be to parse .htaccess to look for rewrite rules

    Is this the file we are talking about? https://github.com/silverstripeltd/demo-project/blob/master/.htaccess
    I don't know how to parse it. I considered matching the word index, but this file doesn't include it.

    Note that there are likely also other valid reasons to want to suppress this warning, for example someone developing a CLI application won't have an index.php file.

    That's already covered. The warning doesn't appear when using a generic webserver_type.

  6. ChloeSartorelli commented on Jun 2, 2025

    @ChloeSartorelli
    Contributor

    It's understandable, but it's just a warning. We added it because of frequent support requests about 403 errors. Therefore, from our point of view, it is better to have it.

    I agree it's better to have it by default. But it would be nice to be able to silence it for projects it doesn't pertain to. For the same reasons that generic project types don't have this warning at all. Imagine a junior dev jumping on a project that is set up as described in the issue description and getting this warning. Alarm bells ring "oh no I've done something wrong".

    adding more small options like this would be a maintenance burden.

    Is there another way it can be silenced on a per-project basis? If not... how much maintenance burden is it? To implement it you'd need:

    1. One if statement in or surrounding warnMissingDocroot()
    2. A few lines to add the actual configuration
      1. One line to add the flag in init() in config.go
      2. One (or two including comment) line adding a var in config.go
      3. A condition to add the config to the app in handleMainConfigArgs() in config.go
      4. One line to add the config to the DdevApp struct in ddevapp.go
    3. Add a line in the documentation about it

    It's more than nothing, for sure, but that all seems like a "do it once" job. As far as actual maintenance burden, how often do you expect the above to need to be updated?

    The other alternative (which would be very user friendly but probably more effort than it's worth) could be to parse .htaccess to look for rewrite rules

    Is this the file we are talking about? https://github.com/silverstripeltd/demo-project/blob/master/.htaccess
    I don't know how to parse it. I considered matching the word index, but this file doesn't include it.

    Yes that's the file - but again that is almost certainly not the way to go about it. That would introduce new maintenance burden, unless there's a go library that will parse it for you.
    For reference, .htaccess is for configuring apache. RewriteRule specifically is the main directive that reroutes things, but there's likely mulitple ways to do it so trying to handle them all is not a robust way forward for this issue.

    Note that there are likely also other valid reasons to want to suppress this warning, for example someone developing a CLI application won't have an index.php file.

    That's already covered. The warning doesn't appear when using a generic webserver_type.

    Oh, interesting. I thought generic was just a project type, not a web server type as well.

  7. stasadev commented on Jun 3, 2025

    @stasadev
    Member

    Ideally, I would like to be able to change the default error message:

    Why did they hardcode it? 🤔
    Doing this requires patching the source code and building it yourself, which is too much effort.

    And overriding 403 errors in files can break existing custom configs because, for example, nginx cannot have two identical directives.


    Is there another way it can be silenced on a per-project basis? If not... how much maintenance burden is it? To implement it you'd need:

    If we do this, it should be generic enough to cover different warnings.
    For example, there are warnings like "The #ddev-generated signature was not found in the file, so it will not be overwritten."
    I see these in my projects all the time and I'm used to them.
    (I actually don't want to see them because I already know I'm using a customized config, but I don't ask to silence them.)
    Also there are warnings like "Using custom web-build configuration:", which people may not want to see as well.

    But I don't want to add any config for this since it's an edge case that can be worked around. Or maybe we can find a better solution for this, then this config won't even be needed.


    I didn't mention it, but we can check for the .htaccess file existence (without checking it's content).
    I guess people who don't understand docroot, may set to to some random folder, which doesn't have the right stuff at all.

    And we can improve the warning message to explain it better, i.e. add this line:

    If the webserver rewrites to a different docroot, this warning may not apply.
    

    (Or change the warning color to the default one to make it less noticeable.)

  8. stasadev commented on Jun 3, 2025

    @stasadev
    Member

    This PR should meet your expectations:

    It’s simpler than adding a new config.

  9. stasadev commented on Jun 11, 2025

    @stasadev
    Member

    @n8-dev,

    If the .htaccess file matches this https://github.com/silverstripeltd/demo-project/blob/master/.htaccess

    Then using:

    ddev config --docroot=public && ddev restart
    

    would remove the warning, and the docroot change only applies to DDEV.

    So the problem is resolved?

  10. ChloeSartorelli commented on Jun 11, 2025

    @ChloeSartorelli
    Contributor

    Unfortunately as mentioned in #7345 (comment)

    having public/ as the docroot is more technically correct for Silverstripe CMS projects - that just unfortunately [...] doesn't match up with how it's set up in the official hosting platform. So anyone wanting to match that hosting environment must use the less technically correct but more situationally appropriate docroot ./

  11. stasadev commented on Jun 12, 2025

    @stasadev
    Member

    I see, so using public locally with DDEV does make a difference?

    Or is DDEV running directly in Silverstripe Cloud? (I might be missing the use case.)

    I used this file https://github.com/silverstripeltd/demo-project/blob/master/.htaccess, placed it in the app root, and booted a dummy project with public/index.php. It worked for both --docroot="" and --docroot=public in my setup.

  12. ChloeSartorelli commented on Jun 12, 2025

    @ChloeSartorelli
    Contributor

    It only really makes a difference if there are specific rules in the .htaccess file that modify how requests are handled, which isn't the case for all projects but my understanding is it's also not too uncommon (@n8-dev probably has a better feel for that than I do)

  13. added 5 commits that reference this issue on Jul 31, 2026
    db6443f
    5e48b25
    5db5d21
    fc9c6c0
    b440e43
  14. added a commit that references this issue on Aug 2, 2026
    f3a5170
  15. added a commit that references this issue on Aug 3, 2026
    5b5987f
  16. github-actions commented on Sep 2, 2026

    @github-actions

    🎉 This issue was fixed in the v1.25.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions