Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

robots_rerouter

1 sites No security coverage
View on drupal.org

Robots Rerouter dynamically serves robots.txt based on environment. Prevents search engine indexing of non-production sites with minimal config.

Features

Robots Rerouter serves a different robots.txt response depending on the current domain.

βœ… Serves a custom robots.txt for production
🚫 Serves a disallow-all fallback for non-production environments (QA, Stage, Dev)
πŸ” Prevents accidental indexing of staging/test sites by search engines
πŸ›  Admin config form allows you to:
- Define the production hostname (e.g. www.example.com)
- Specify file paths for both production and fallback robots.txt

🧩 Smart behavior:
- Automatically creates the folders and files under public:// if they don’t exist
- Ensures secure, sandboxed file handling even on hosted environments like Acquia

Use Cases:
- You're managing multiple environments and want only the live site indexed
- You've seen Google index staging/dev accidentally before and need a safety net
- You're using CI/CD or Composer-based deployments and want to avoid .htaccess hacks

Post-Installation

After enabling the module:

1. Visit:
/admin/config/search/robots-rerouter

2. Configure:
- Production Hostname (e.g., www.example.com)
- Production File Path: e.g., robots/good_robots.txt
- Fallback File Path: e.g., robots/nocrawl_robots.txt

3. On save:
- Any missing folders or files will be automatically created in public://

Then when a user visits /robots.txt:
- If the domain matches your production hostname, it serves the production file
- Else, it serves the disallow-all fallback file

Additional Requirements

- No contributed modules are required.
- Files are created automatically under public://, but you may optionally upload your own content (especially the production robots.txt).
- Example fallback content:
User-agent: *
Disallow: /

Activity

Total releases
2
First release
Aug 2025
Latest release
8 months ago
Release cadence
0 days
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Aug 7, 2025
1.0.x-dev Dev Aug 7, 2025