You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to disable/ modify ddev start docroot index.* check #7345
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.
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.
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
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.
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.
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.
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
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
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 genericwebserver_type.
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:
One if statement in or surrounding warnMissingDocroot()
A few lines to add the actual configuration
One line to add the flag in init() in config.go
One (or two including comment) line adding a var in config.go
A condition to add the config to the app in handleMainConfigArgs() in config.go
One line to add the config to the DdevApp struct in ddevapp.go
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
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.
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.)
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 ./
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)
Activity
[-]Ability to disable/ modify `ddev start` root index.* check[/-][+]Ability to disable/ modify `ddev start` docroot index.* check[/+]ChloeSartorelli commentedon May 29, 2025
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.yamlis appropriate.ChloeSartorelli commentedon May 29, 2025
The other alternative (which would be very user friendly but probably more effort than it's worth) could be to parse
.htaccessto 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.
ChloeSartorelli commentedon May 29, 2025
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.phpfile.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.
stasadev commentedon May 30, 2025
@n8-dev,
We check for any
index.*file in thedocroot. If the warning is annoying, you can create a dummyindex.whateverfile in thedocroot, commit it or add it to.gitignore, and the warning will stop.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.
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,
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.That's already covered. The warning doesn't appear when using a
genericwebserver_type.ChloeSartorelli commentedon Jun 2, 2025
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".
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:
warnMissingDocroot()init()inconfig.govarinconfig.gohandleMainConfigArgs()inconfig.goDdevAppstruct inddevapp.goIt'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?
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,
.htaccessis for configuring apache.RewriteRulespecifically 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.Oh, interesting. I thought
genericwas just a project type, not a web server type as well.stasadev commentedon Jun 3, 2025
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.
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
.htaccessfile 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:
(Or change the warning color to the default one to make it less noticeable.)
stasadev commentedon Jun 3, 2025
This PR should meet your expectations:
docrootwarning when.htaccessfile is present, fixes #7345 #7349It’s simpler than adding a new config.
stasadev commentedon Jun 11, 2025
@n8-dev,
If the
.htaccessfile matches this https://github.com/silverstripeltd/demo-project/blob/master/.htaccessThen using:
would remove the warning, and the
docrootchange only applies to DDEV.So the problem is resolved?
ChloeSartorelli commentedon Jun 11, 2025
Unfortunately as mentioned in #7345 (comment)
stasadev commentedon Jun 12, 2025
I see, so using
publiclocally 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=publicin my setup.ChloeSartorelli commentedon Jun 12, 2025
It only really makes a difference if there are specific rules in the
.htaccessfile 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)feat(webserver): explain webserver-level 403s, fixes ddev#8595, fixes d…
feat(webserver): explain webserver-level 403s, fixes ddev#8595, fixes d…
feat(webserver): explain webserver-level 403s, fixes ddev#8595
feat(webserver): explain webserver-level 403s, fixes ddev#8595
feat(webserver): explain webserver-level 403s, fixes ddev#8595
feat(webserver): explain webserver-level 403s, fixes ddev#8595
feat(webserver): explain webserver-level 403s, fixes ddev#8595, fixes d…
github-actions commentedon Sep 2, 2026
🎉 This issue was fixed in the v1.25.4 release.
fix(webserver): stop the 403 explanation from disabling directory lis…
fix(webserver): stop the 403 explanation from disabling directory lis…
fix(webserver): stop the 403 explanation from disabling directory lis…
fix(webserver): stop the 403 explanation from disabling directory lis…