You are here

README.txt in Domain Access 7.3

README file for Domain Alias

File

domain_alias/README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Alias
  4. */
  5. Domain Access: Domain Alias
  6. Advanced domain matching methods for Domain Access.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 1.1 Use-Case
  11. 1.2 Example
  12. 1.3 Developers
  13. 2. Installation
  14. 2.1 Dependencies
  15. 2.2 Configuration Options
  16. 3. Alias Management
  17. 3.1 Creating Aliases
  18. 3.2 Updating Aliases
  19. 3.3 Pattern Matching Options
  20. 3.4 Redirecting Aliases
  21. 4. Developer Notes
  22. 4.1 Database Schema
  23. ----
  24. 1. Introduction
  25. The Domain Access: Domain Alias module, is an optional extension of the
  26. Domain Access module. Domain Alias provides advanced options
  27. for configuring domain request handling by your site.
  28. ----
  29. 1.1 Use-Case
  30. Some sites have very specific rules for displaying their urls to users.
  31. For example, yahoo.com redirects all site visitors to www.yahoo.com,
  32. whereas drupal.org redirects all requests to www.drupal.org to the
  33. canonical url drupal.org.
  34. Supporting these conflicting rules led to the creation of Domain Alias,
  35. a system for managing domain handling for multiple domains that
  36. should be treated as a single domain by the Domain Access module.
  37. This module is useful for cases where wildcard DNS is supported, or
  38. when you cannot modify your DNS hosts file.
  39. ----
  40. 1.2 Example
  41. Let us assume that our main site is example.com and we run two
  42. sub sites at users.example.com and testing.example.com.
  43. Out sample site allows wildcard DNS, so any request to
  44. *.example.com will be passed to our Drupal site. We would like the
  45. following rules to be obeyed:
  46. -- www.example.com should redirect to example.com.
  47. -- exmpl.com, which we also own, should be treated as a request to
  48. example.com.
  49. -- *.users.example.com should inherit the settings for users.example.com.
  50. -- *.testing.example.com should be treated as invalid and directed to
  51. example.com.
  52. Under this complex scenario, we would configure the following domains:
  53. -- Primary domains == example.com
  54. -- Domain 1 == users.example.com
  55. -- Domain 2 == testing.example.com
  56. Under Domain Alias, we would then enable the following settings for each domain.
  57. == example.com ==
  58. exmple.com [no redirect]
  59. www.example.com [redirect]
  60. *.testing.example.com [redirect]
  61. == users.example.com ==
  62. *.users.example.com [no redirect]
  63. == testing.example.com ==
  64. No aliases needed.
  65. See section 3 for more information about configuring aliases.
  66. ----
  67. 1.3 Developers
  68. Original code by bforchhammer -- -http://drupal.org/user/216396.
  69. See http://drupal.org/node/284422 for bacjground.
  70. ----
  71. 2. Installation
  72. The Domain Alias module is included in the Domain Access download. To install,
  73. untar the domain package and place the entire folder in your modules directory.
  74. When you enable the module, it will create a {domain_alias} table in your Drupal
  75. database.
  76. ----
  77. 2.1 Dependencies
  78. Domain Alias requires the Domain Access module be installed and active.
  79. ----
  80. 3. Alias Management
  81. The Domain Alias module adds a new column to the Domain List table. Go to the
  82. Domain List at Admin > Structure > Domains (admin/structure/domain). Click on
  83. edit domain of the desired domain. click on "aliases" tab. You should see the
  84. aliases on this page.
  85. ----
  86. 3.1 Creating Aliases
  87. To create a new alias, go to the Domain List at Admin > Structure > Domains
  88. (/admin/structure/domain). click on edit domain of the desired domain. Click on
  89. "Aliases: tab. You should see the aliases on this page.
  90. On this page You will be presented with a form divided into two parts. The top
  91. section, 'Registered aliases for *' will be empty initially.
  92. Under 'Add new aliases,' you may add up to five (5) aliases at a time. (If you
  93. need to add more, enter the first five and save the form.)
  94. Check the 'redirect' box only if you wish to redirect requests made to the alias
  95. to go to the registered domain for that alias.
  96. Enter the pattern(s) that you wish to match and click 'Save aliases.'
  97. With the advent of Internationalized Domain Names (IDNs), domain servers
  98. are beginning to recognize non-ASCII domain names. To enable support for
  99. non-ASCII domain names, you must add the following lines to the bottom
  100. of your settings.php file:
  101. // Allow registration of non-ASCII domain strings.
  102. $conf['domain_allow_non_ascii'] = TRUE;
  103. ----
  104. 3.2 Updating Aliases
  105. Once you have created a set of aliases, the 'Aliases' tab on the selected Domain
  106. edit form(admin/structure/domain/view/[domain_id]/alias)will show the current
  107. aliases. The top section of the form will show your current registered aliases.
  108. To modify an alias, simply change the pattern text or toggle the redirect
  109. option.
  110. To delete an alias, check the 'Delete' box on the right side of the form.
  111. Click 'Save aliases' to make your changes.
  112. ----
  113. 3.3 Pattern Matching Options
  114. The patterns that you may enter can be simple strings, like one.example.com.
  115. You may also use wildcard characters for advanced pattern matching.
  116. You may specify a pattern for your domains by using * (asterisk) to match any
  117. number of random characters and ? (question mark) to match exactly one random
  118. character.
  119. For example: *.example.com would match any HTTP request made to a subdomain of
  120. example.com to the domain record for example.com.
  121. Using wildcards is a good way to reduce the number of aliases that you need to
  122. maintain.
  123. NOTE: Only one wildcard is allowed per alias.
  124. ----
  125. 3.4 Redirecting Aliases
  126. For each alias that you create, you have the option of forcing a redirect when
  127. users make a request to that domain. If enabled, redirects will send the user
  128. to the registered domain.
  129. This setting is unique to each alias.
  130. For example, you may want to handle requests to example.com as follows:
  131. -- Leave www.example.com alone.
  132. -- Direct all other requests to example.com.
  133. In this case, example.com is the 'registered domain,' and you would create the
  134. following aliases:
  135. -- www.example.com [no redirect]
  136. -- *.example.com [redirect]
  137. This feature can be used in conjunction with the Domain Access setting for WWW
  138. Prefix Handling (see 4.3.5 WWW Prefix Handling in the main README.txt). However,
  139. you must take care not to set up an infinite redirect loop when configuring your
  140. aliases.
  141. ----
  142. 4. Developer Notes
  143. For information on the development of Domain Alias, see:
  144. -- http://drupal.org/node/284422
  145. -- http://drupal.org/node/306495
  146. -- http://drupal.org/node/293453
  147. ----
  148. 4.1 Database Schema
  149. Installing the module creates a {domain_conf} table that contains:
  150. - alias_id
  151. Integer, unique
  152. The lookup key for the record.
  153. - domain_id
  154. Integer
  155. The matching key for this record, foreign key to the {domain} table.
  156. - pattern
  157. Varchar (255)
  158. The alias pattern to match against inbound requests.
  159. - redirect
  160. Integer (tiny)
  161. A boolean flag indicating that requests made to this alias should be
  162. redirected to the assigned domain_id.