This section provides information on common domain troubleshooting scenarios.
All redirect logic should include the
php_sapi_name() != "cli" conditional statement to see if WordPress or Drupal is running via the command line. Drush and WP-CLI are used by the platform for operations like cache clearing and search and replace, so it is important to only redirect web requests, otherwise the redirect will cancel the PHP process before Drush or WP-CLI is executed, resulting in a silent failure:
[notice] Command: site.env -- 'drush <command>' [Exit: 1] [error]
Errors referencing too many redirects may be a result of using the
$_SERVER['HTTP_X_FORWARDED_PROTO'] variable within redirect logic located in your site's
Resolve this error by replacing the offending redirect logic with the recommended code samples in the above section and for your specific use case.
Modules and plugins that support managing redirects in the Site Admin interface can produce redirect errors when repeating or conflicting with redirects managed via PHP in your site's configuration file. Some examples include:
WordPress plugins: Redirection, Quick Page/Post Redirect, Safe Redirect Manager, Simple 301 Redirects
Drupal modules: Language (when using URL detection), Securepages, Redirect
When troubleshooting a redirect loop, you may want to deactivate any module or plugin that may be providing its own redirect logic.
If you have your name server configured to use a mixed case domain, visitors might not be able to access your site.
Configure your DNS to accept an entirely lowercase domain to avoid this issue.
You can modify your local
hosts file to validate domain-specific settings before DNS is in place.
Note that modifying the
hosts file usually requires administrative privileges from the OS.
The location of the
hosts file varies depending on your operating system:
- MacOS / Linux:
Add lines to your operating system's
hosts file in the following format:
203.0.113.10 example.com 203.0.113.20 www.example.com
In the example above, replace the IP addresses with those provided by Pantheon, and the domains with your own.