Index.php Redirect
Index.php Redirect
Index.php Redirect automatically redirects Drupal URLs that expose the index.php front controller to their clean equivalents.
For example:
/index.php/documents/reportis redirected to:
/documents/reportThis helps prevent duplicate URLs, inconsistent links, and unwanted index.php URLs from being indexed by search engines.
Features
- Works immediately after installation with no required configuration.
- Uses a permanent 301 redirect by default.
- Can be configured to use a temporary 302 redirect.
- Preserves the complete path and query string.
- Supports Drupal installations located in a subdirectory.
- Excludes update.php, install.php, cron.php, and authorize.php by default.
- Allows additional excluded paths to be configured.
- Provides optional redirect logging through Drupal's logging system.
- Processes only main GET and HEAD requests, preventing submitted form data from being lost.
- Supports Drupal 10 and Drupal 11.
Post-installation
Enable the module normally. No configuration is required for the default behavior.
Optional settings are available at:
Administration > Configuration > Search and metadata > Index.php RedirectThe configuration page allows administrators to select the redirect status code, manage excluded paths, and enable redirect logging.
Additional requirements
No additional modules or third-party libraries are required.
The web server must already support Drupal clean URLs for the redirect destination to work.
Similar projects
The Redirect module provides comprehensive redirect and canonical URL management. Index.php Redirect is intended as a smaller, focused alternative for sites that only need to remove the /index.php/ component from Drupal URLs.
Legacy Redirect handles older index.php?q=path URL formats. Index.php Redirect instead handles modern URLs using the /index.php/path format.