Prevent indexing of non-production environments by default#371
Draft
Prevent indexing of non-production environments by default#371
Conversation
…ments Co-authored-by: rmccue <21655+rmccue@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Non-production environments should not allow indexing by default
Prevent indexing of non-production environments by default
Oct 7, 2025
Member
|
@copilot Let's rename the configuration item to |
Co-authored-by: rmccue <21655+rmccue@users.noreply.github.com>
Author
Renamed the configuration from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Non-production environments (development, staging, local) were being indexed by search engines by default, which can cause:
Solution
This PR adds a new
allow_indexingconfiguration option to the SEO module that controls whether search engines can index the site. The default behavior is:allow_indexing = true)allow_indexing = false)When indexing is disabled, the
robots.txtfile is automatically modified to include:Implementation
Changes Made
load.php: Addedallow_indexingto default settings that evaluates totrueonly for production environments usingAltis\get_environment_type()inc/namespace.php:bootstrap()to check theallow_indexingsettingallow_indexingisfalse, adds arobots_txtfilter to disallow indexingdisallow_indexing()function to modify the robots.txt outputdocs/README.md:allow_indexingconfiguration optionConfiguration Override
Projects that need to allow indexing in non-production environments can override this setting in their
composer.json:{ "extra": { "altis": { "modules": { "seo": { "allow_indexing": true } } } } }Benefits
trueif not set)Fixes https://github.com/humanmade/terraform-app-stack/issues/1484
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.