example.sites.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // @codingStandardsIgnoreFile
  3. /**
  4. * @file
  5. * Configuration file for multi-site support and directory aliasing feature.
  6. *
  7. * This file is required for multi-site support and also allows you to define a
  8. * set of aliases that map hostnames, ports, and pathnames to configuration
  9. * directories in the sites directory. These aliases are loaded prior to
  10. * scanning for directories, and they are exempt from the normal discovery
  11. * rules. See default.settings.php to view how Drupal discovers the
  12. * configuration directory when no alias is found.
  13. *
  14. * Aliases are useful on development servers, where the domain name may not be
  15. * the same as the domain of the live server. Since Drupal stores file paths in
  16. * the database (files, system table, etc.) this will ensure the paths are
  17. * correct when the site is deployed to a live server.
  18. *
  19. * To activate this feature, copy and rename it such that its path plus
  20. * filename is 'sites/sites.php'.
  21. *
  22. * Aliases are defined in an associative array named $sites. The array is
  23. * written in the format: '<port>.<domain>.<path>' => 'directory'. As an
  24. * example, to map https://www.drupal.org:8080/mysite/test to the configuration
  25. * directory sites/example.com, the array should be defined as:
  26. * @code
  27. * $sites = [
  28. * '8080.www.drupal.org.mysite.test' => 'example.com',
  29. * ];
  30. * @endcode
  31. * The URL, https://www.drupal.org:8080/mysite/test/, could be a symbolic link
  32. * or an Apache Alias directive that points to the Drupal root containing
  33. * index.php. An alias could also be created for a subdomain. See the
  34. * @link https://www.drupal.org/documentation/install online Drupal installation guide @endlink
  35. * for more information on setting up domains, subdomains, and subdirectories.
  36. *
  37. * The following examples look for a site configuration in sites/example.com:
  38. * @code
  39. * URL: http://dev.drupal.org
  40. * $sites['dev.drupal.org'] = 'example.com';
  41. *
  42. * URL: http://localhost/example
  43. * $sites['localhost.example'] = 'example.com';
  44. *
  45. * URL: http://localhost:8080/example
  46. * $sites['8080.localhost.example'] = 'example.com';
  47. *
  48. * URL: https://www.drupal.org:8080/mysite/test/
  49. * $sites['8080.www.drupal.org.mysite.test'] = 'example.com';
  50. * @endcode
  51. *
  52. * @see default.settings.php
  53. * @see \Drupal\Core\DrupalKernel::getSitePath()
  54. * @see https://www.drupal.org/documentation/install/multi-site
  55. */