You are here

README.txt in Domain Access 7.2

README file for Domain Access.

File

README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Access.
  4. */
  5. Domain Access
  6. A domain-based access control system.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 1.1 Use-Case
  11. 1.2 Examples
  12. 1.3 Using Multiple Node Access Modules
  13. 1.4 Known Issues
  14. 1.4.1 Logging In To Multiple Domains
  15. 1.4.2 Cron Handling
  16. 1.4.3 Updating Your Site
  17. 2. Installation
  18. 2.1 Edits to settings.php
  19. 2.2 Server Configuration
  20. 2.3 Creating Domain Records
  21. 2.4 Setting DOMAIN_INSTALL_RULE
  22. 2.5 Setting DOMAIN_SITE_GRANT
  23. 2.6 Setting DOMAIN_ASSIGN_USERS
  24. 3. Permissons
  25. 3.1 Module Permissions
  26. 3.2 Normal Usage
  27. 3.3 Advanced Usage
  28. 3.4 Limitations
  29. 4. Module Configuration
  30. 4.1 Default Domain Settings
  31. 4.1.1 Primary Domain Name
  32. 4.1.2 Site Name
  33. 4.1.3 Domain URL Scheme
  34. 4.2 Creating Domain Records
  35. 4.2.1 Restricted Characters in Domains
  36. 4.2.2 Altering Domain Name Validation
  37. 4.3 Domain Module Behaviors
  38. 4.3.1 New Content Settings
  39. 4.3.2 Debugging Status
  40. 4.3.3 Enforce Rules on Adminstrators
  41. 4.3.4 Sort Domain Lists
  42. 4.3.5 Domain Selection Format
  43. 4.4 Advanced Settings
  44. 4.4.1 Search Settings
  45. 4.4.2 Search Engine Optimization
  46. 4.4.3 Default Source Domain
  47. 4.4.4 WWW Prefix Handling
  48. 4.4.5 Node Access Settings
  49. 4.5 Special Page Requests
  50. 4.5.1 Cron Handling
  51. 4.5.2 XMLRPC Handling
  52. 4.6 Node Link Patterns
  53. 4.7 The Domain List
  54. 4.8 Node Settings
  55. 4.8.1 Domain Node Editing
  56. 4.8.2 Domain Node Types
  57. 4.9 Batch Updating
  58. 4.10 Assigning Users to Domains
  59. 4.11 Batch Assignment of Users to Domains
  60. 4.11.1 Form Behavior
  61. 5. Blocks
  62. 5.1 Block -- Domain Switcher
  63. 5.2 Block -- Domain Access Information
  64. 5.3 Block -- Domain Access Server Information
  65. 6. Node Access
  66. 6.1 Assigning Domain Access
  67. 6.2. Editor Access
  68. 6.3 Realms
  69. 6.4 Grants
  70. 6.5 Warnings
  71. 7. Developer Notes
  72. 7.1 Extension Modules
  73. 7.2 The $_domain Global
  74. 7.3 Database Schema
  75. 7.4 API
  76. 7.5 drush and Domain Access
  77. 7.6 Domain Tokens
  78. ----
  79. 1. Introduction
  80. Before using the module, you should read the installation instructions found
  81. in INSTALL_QUICKSTART.txt.
  82. The Domain Access module group is designed to run an affiliated network of sites
  83. from a single Drupal installation. The module allows you to share users,
  84. content, and configurations across a group of sites such as:
  85. - example.com
  86. - one.example.com
  87. - two.example.com
  88. - my.example.com
  89. - thisexample.com
  90. - anothersite.com
  91. - example.com:3000 <-- non-standard ports are treated as unique domains.
  92. By default, these sites share all tables in your Drupal installation.
  93. The module uses Drupal's node_access() system to determine what content is
  94. available on each site in the network. Unlike other multi-domain modules for
  95. Drupal, the Domain Access module determines user access based on the active
  96. domain that the user is viewing, rather than which group or site the user
  97. belongs to.
  98. Additionally, when a user creates content, that content will automatically be
  99. assigned to the currently active domain unless the user has specific
  100. privileges to be able to assign domain access. Under advanced setups, the
  101. ability to edit content for a specific domain can be segregated from the
  102. typical Drupal privilege to 'Bypass content access control.'
  103. For more information about Domain Access privileges, see section 3.
  104. For more information about node_access(), see
  105. http://api.drupal.org/api/group/node_access/6
  106. ----
  107. 1.1 Use-Case
  108. The module was initially developed for a web site that sold franchises of a
  109. monthly magazine. The publishing rules were as follows:
  110. - Content may belong to the national site, one or more affiliates, or to
  111. all affiliates.
  112. - National editors may select to promote affiliate content to other
  113. affiliates, the national site, or to all affiliates.
  114. - Local editors may only create and edit content for their own affiliate
  115. sites.
  116. These rules are enforced programmatically by the Domain Access module. There
  117. was concern that, if given a choice to make, local editors would not assign the
  118. content correctly. Therefore, the module handles this automatically, and local
  119. editors have no control over which domains their content is published to.
  120. This video from DrupalCon Paris explains the module in detail:
  121. http://www.archive.org/details/SharingcontentacrossmultiplesiteswithDomainAccess
  122. ----
  123. 1.2 Examples
  124. For the original example of the module in use, see http://skirt.com/.
  125. For case-studies, see:
  126. http://drupal.org/node/369398
  127. http://www.trellon.com/content/blog/sharing-content-domain-access
  128. Sites using Domain Access include:
  129. * www.barnard.edu (Drupal 7)
  130. * www.interlochen.org
  131. * www.skirt.com
  132. * www.dzone.com
  133. * www.itgjamaica.com
  134. * www.rowelevenwines.com
  135. * www.weecology.org
  136. * www.komonews.com/communities
  137. ----
  138. 1.3 Using Multiple Node Access Modules
  139. Node Access is a complex issue in Drupal. Typically, sites will only use
  140. one node access module at a time. In some cases, you may require
  141. more advances acceess control rules.
  142. Two important issues to understand are:
  143. 1. User 1 and users with the 'Bypass node access' permission are not
  144. subject to node access rules. See section 4.3.3 for more details.
  145. 2. Node Access is a permissive API. If you use more than one Node Access
  146. module (such as Organic Groups), if either module grants access, users will
  147. be given access.
  148. Changes to these core behaviors require custom code solutions.
  149. ----
  150. 1.4 Known Issues
  151. There are some issues that occur when Domain Access is used outside
  152. of its original use case. These are probably fixable, but may not work
  153. as you expect. You should pay careful attention to your site behavior.
  154. ----
  155. 1.4.1 Logging In To Multiple Domains
  156. The Domain Access module allows the creation of domains with different
  157. hosts. However, security standards dictate that cookies can only be
  158. read from the issuing domain.
  159. As a result, you may configure your site as follows, but when you do so,
  160. users cannot be logged through a single sign in.
  161. example.com
  162. one.example.com
  163. myexample.com
  164. thisexample.com
  165. While example.com and one.example.com can share a login cookie, the
  166. other two domains cannot read that cookie. This is an internet standard,
  167. not a bug.
  168. Note: See the INSTALL.txt for instructions regarding Drupal's default
  169. cookie handling.
  170. ----
  171. 1.4.2 Cron Handling
  172. When Drupal's cron function runs, it operates on the domain from which
  173. the cron.php script is invoked. That is, if you setup cron to run from:
  174. http://one.example.com/cron.php
  175. In this case, Domain Access will check the access settings for that domain.
  176. This behavior has been known to cause issues with other contributed modules.
  177. As a solution, we normally disable Domain Access rules when cron runs.
  178. For more information, see section 4.5.1 Cron Handling.
  179. If you encounter any cron-related issues, please report them at:
  180. http://drupal.org/project/issues/domain
  181. ----
  182. 1.4.3 Updating Your Site
  183. For upgrade instructions, see the provided UPGRADE.txt.
  184. ----
  185. 2. Installation
  186. WARNING: The Domain Access module assumes that you have already installed
  187. and configured your Drupal site. Please do so before continuing.
  188. Installing the module requires that you share a single copy of settings.php
  189. for all domains that will be registered with Domain Access.
  190. You must also add code to that settings.php file in order to load the domain
  191. handling code. See INSTALL_QUICKSTART.txt for instructions.
  192. For detailed instructions, see INSTALL.txt.
  193. After you have completed the steps outlined by the installer, you may enable
  194. the module normally. When you enable the module, it will create a {domain} table
  195. in your Drupal database.
  196. All existing nodes and users on your site will be assigned to the default domain
  197. for your web site. Existing content will be set to be visible on all new
  198. domains. If you wish to alter this behavior, see sections 2.4 through 2.6.
  199. ----
  200. 2.1 Edits to settings.php
  201. Please see the documentation in INSTALL.txt or INSTALL_QUICKSTART.txt
  202. ----
  203. 2.2 Server Configuration
  204. For the module to work correctly, the DNS record of your server must accept
  205. multiple DNS entries pointing at a single IP address that hosts your Drupal
  206. installation.
  207. The two basic methods for doing this are either to:
  208. - Setup WildCard DNS, so that *.example.com resolves to your Drupal site.
  209. - Setup VirtualHosts so that one.example.com, two.example.com, etc. all
  210. resolve to your Drupal site.
  211. For example, on my local testing machine, I have VirtualHosts to the following
  212. sites setup in httpd.conf:
  213. - example.com => 127.0.0.1
  214. - one.example.com => 127.0.0.1
  215. - two.example.com => 127.0.0.1
  216. - three.example.com => 127.0.0.1
  217. It is beyond the scope of this document to explain how to configure your DNS
  218. server. For more information, see:
  219. - http://en.wikipedia.org/wiki/Wildcard_DNS_record
  220. - http://en.wikipedia.org/wiki/Virtual_hosting
  221. After you have enabled multiple DNS entries to resolve to your Drupal
  222. installation, you may activate the module and configure its settings.
  223. No matter how many domains resolve to the same IP, you only need one instance
  224. of Drupal's settings.php file. The sites folder should be named 'default' or
  225. named for your root domain.
  226. NOTE: If you choose the WildCard DNS option, any subdomain not controlled
  227. by the Domain module, including misspelled subdomains, will go to the default
  228. domain without a redirect. To properly redirect invalid subdomains, use the
  229. Domain Alias module and set *.example.com as an alias of your primary domain
  230. with the 'redirect' setting checked. More information can be found in the
  231. README.txt in the domain_alias directory.
  232. ----
  233. 2.3 Creating Domain Records
  234. After you enable the module, you will have a user interface for registering new
  235. domains with your site. For these to work correctly, they must also be
  236. configured by your DNS server.
  237. To be clear: creating a new domain record through this module will not alter
  238. the DNS server of your web server.
  239. ----
  240. 2.4 Setting DOMAIN_INSTALL_RULE
  241. This is an advanced instruction, and may be ignored.
  242. At the top of the domain.module file, you will find this line:
  243. define('DOMAIN_INSTALL_RULE', TRUE);
  244. This setting controls the default behavior of the module when installing over
  245. an existing installation. If set to TRUE, the Domain Access module will assign
  246. all existing nodes to be viewable by your primary domain.
  247. If you set this value to FALSE, existing content will not be visible on your
  248. primary domain unless DOMAIN_SITE_GRANT is set to TRUE.
  249. For more details, see section 6.
  250. ----
  251. 2.5 Setting DOMAIN_SITE_GRANT
  252. At the top of the domain.module file, you will find this line:
  253. define('DOMAIN_SITE_GRANT', TRUE);
  254. This setting controls the default behavior for viewing affiliate content.
  255. By design, the Domain Access module allows site administrators to assign
  256. content to 'all affiliates.' If this value is set to TRUE, then content
  257. assigned to all affiliates can be seen by all users on all current domains.
  258. On install, setting this value to TRUE will assign all current content to
  259. be viewable on all domains.
  260. Normally, you will not need to edit this value.
  261. ----
  262. 2.6 Setting DOMAIN_ASSIGN_USERS
  263. At the top of the domain.module file, you will find this line:
  264. define('DOMAIN_ASSIGN_USERS', TRUE);
  265. After you install the Domain Access module, all new users who
  266. register will automatically be assign to the domain from which
  267. their account was created. This value is used to determine
  268. advanced editing access and can be used by modules such as
  269. Domain Strict.
  270. On install, setting this value to TRUE will assign all current users
  271. to be members of the default domain. Set the value to FALSE
  272. and the module will not assign users to any domains.
  273. Normally, you will not need to edit this value.
  274. After installation and configuration, users with the appropriate
  275. permissions may batch assign users to domains from
  276. Administer > User Management > Users.
  277. ----
  278. 3. Permissions
  279. After enabling the module, go to Access Control to configure the module's
  280. permissions.
  281. ----
  282. 3.1 Module Permissions
  283. The Domain Access module has the following permissions:
  284. - 'Administer domain records and settings'
  285. This permission allows users to create and manage domain records
  286. and settings.
  287. - 'Access inactive domains'
  288. This permission allows users to navigate to domains which are marked
  289. as inactive. Users with this permission may also assign content to an
  290. inactive domain.
  291. 'Assign editors to domains'
  292. This permission allows users to assign themselves and other users as
  293. affiliate editors. For those users to act as editors, their role(s) must also
  294. have the 'Edit any content on assigned domains' permission.
  295. - 'Edit any content on assigned domains'
  296. This permission is for advanced use and substitutes for the normal
  297. 'Bypass content access control' permission for sites that give restricted
  298. administrative privileges. See section 3.3 for more information.
  299. - 'Delete any content on assigned domains'
  300. This permission is for advanced use and substitutes for the normal
  301. 'Bypass content access control' permission for sites that give restricted
  302. administrative privileges. See section 3.3 for more information.
  303. - 'Set domain access status for all content'
  304. This permission is key. Users with this permission will be given a user
  305. interface for assigning users and nodes to specific domains. Users without
  306. this permission cannot assign domain access; their nodes will automatically
  307. be assigned to the currently active domain.
  308. For example, if a user has this permission and creates a book page on
  309. one.example.com, the user will be given a series of options to assign that
  310. book page to any or all of the registered domains on the site.
  311. If the user does not have this permission, the book page will only be shown
  312. to users who are on http://one.example.com.
  313. - 'Publish content only from the default domain'
  314. - 'Publish content only from assigned domain'
  315. - 'Publish content to any assigned domain'
  316. This group of permission provides a limited set of options for users to create
  317. and edit content on your site. Users who have this permission will have their
  318. node editing forms processed according to the following rules:
  319. -- 'Publish content only from the default domain'
  320. Before being presented the editing form, users will be taken to the root
  321. domain. If the node is not visible on the root domain, the user may not be
  322. able to edit the node.
  323. -- 'Publish content only from assigned domain'
  324. Before being presented the editing form, users will be taken to the
  325. first domain assigned to their user account. This function is most useful
  326. when you users are only allowed to enter content from a single domain.
  327. Note that for users who have more than one assigned domain, this option
  328. will take them to the first match and the user will not be allowed to
  329. change the domain affiliation.
  330. The advantage of this option is the user cannot modify the URL of a
  331. content edit form to match the URL of other domains, forcing all of her
  332. posts to be made to a single domain. Users trying to enter content
  333. from another domain will always be transferred to their assigned domain.
  334. In effect, a user assigned to 'one.example.com' will only be able to post
  335. to that domain, even if she clicks Create Content from two.example.com.
  336. -- 'Publish content to any assigned domain'
  337. The node editing form is shown normally, and the user is presented a
  338. list of checkboxes or a multiple select list. These options represent the
  339. affiliate domains that the user is allowed to publish content to, according
  340. to the domains assigned to their user account.
  341. Note that if this option is selected, users will also be shown a list of
  342. affiliates to which the node is assigned. This list shows only the
  343. affiliates that the user cannot edit.
  344. Warning: If this option is selected and the user has no domain publishing
  345. options, the user will not be allowed to post or edit!
  346. NOTE: Users who are assgined _none_ of these permissions and cannot
  347. 'Set domain access status for all content' will have the default form values
  348. passed as hidden fields. This setting is the default option. It will assign
  349. all content to the domain from which the form is entered.
  350. Note also that the user is not given the ability to promote content to
  351. 'all affiliates'. Users who need this ability should be given the 'set domain
  352. access' permission instead.
  353. This feature was added in response to http://drupal.org/node/188275.
  354. ----
  355. 3.2 Normal Usage
  356. Under a normal Drupal site, a single administrator (or a handful of equally
  357. trusted administrators) typically have the 'Bypass content access control'
  358. permission and individual 'TYPE: edit all content' permissions.
  359. The only choices for permissions would be who gets to administer the module
  360. settings and who gets to assign nodes to specific domains. Generally, only
  361. users who you trust to 'administer site configuration' should be given the
  362. 'Administer domain records and settings' permission. As for 'set domain
  363. access,' that can be given to any user you trust to use the settings properly.
  364. ----
  365. 3.3 Advanced Usage
  366. In the event that you wish to segregate which content certain editors can
  367. control, you should not use the normal 'edit any TYPE nodes' and 'delete any
  368. TYPE nodes' permissions provided by Drupal's core Node module.
  369. These permissons grant the ability for a user to edit and delete all nodes of a
  370. given type.
  371. In the Domain Access model, these permissions are not used in favor of the
  372. provided 'Edit any content on assigned domains' and 'Delete any content on
  373. assigned domains' permissions. These permissions allow editors only to edit
  374. (or delete) nodes that belong to their domain.
  375. To enable this feature, you should grant the 'Edit any content on assigned
  376. domains' and (optionally) the 'Delete any content on assigned domains'
  377. permission to some roles. Then assign individual users accounts to specific
  378. domains to assign them as Domain Editors.
  379. NOTE: Users with the 'Delete any content on assigned domains' permission must
  380. also be given the 'Edit any content on assigned domains' permission in order to
  381. delete content.
  382. ----
  383. 3.4 Limitations
  384. Due to the way node_access() works, the following limitations should be noted.
  385. - Any node that is assigned to more than one domain can be edited
  386. by any editor who belongs to one of the domains.
  387. - Users who look at the sites and have the 'Bypass content access control'
  388. permission can always see all content on all sites, which can be confusing.
  389. To enforce Domain Access rules on these users, you may enable the
  390. 'Enforce rules on administrators' setting described in 4.3.3.
  391. - Users who have the 'edit any TYPE nodes' permission will be able to edit
  392. nodes that do not belong to their domain.
  393. These limitations are due to the permissive nature of node_access(). If any
  394. access rule grants you permission, it cannot be taken away.
  395. ----
  396. 4. Module Configuration
  397. The settings for Domain Access are listed under Site Building. The path is
  398. 'admin/build/domain'.
  399. ----
  400. 4.1 Default Domain Settings
  401. These elements define the 'primary' domain for your site. In the event that a
  402. user tries to access an invalid domain, this domain will be used.
  403. ----
  404. 4.1.1 Primary Domain Name
  405. The primary domain for your site. Typically example.com or www.example.com.
  406. Do not use http or slashes. This domain will be used as the default URL for your
  407. site. If an invalid domain is requested, users will be sent to the primary
  408. domain.
  409. Enter the primary domain for your site here. Typically, you will also enter
  410. this value into settings.php for cookie handling. Do not use http:// or a
  411. trailing slash when entering this value.
  412. NOTE: If you have installed Drupal in a subfolder, such as
  413. http://example.com/drupal you should not include the folder path
  414. as part of the primary domain. Simply use example.com -- Drupal
  415. will automatically detect the presence of the subfolder.
  416. NOTE: As of 5.x.1.5 and higher, you may use a port protocol as part
  417. of any domain. So you could set example.com:8080 as the primary
  418. domain name. Note that port protocols will not be stripped, so that
  419. example.com and example.com:8080 are two separate domains.
  420. ----
  421. 4.1.2 Site Name
  422. This value is taken from your system settings and need not be changed. It is
  423. provided to allow readbility in the domain list.
  424. ----
  425. 4.1.3 Domain URL Scheme
  426. Allows the site to use 'http' or 'https' as the URL scheme. Default is
  427. 'http'. All links and redirects to root site will use the selected scheme.
  428. ----
  429. 4.2 Creating domain records
  430. As noted above, this screen does not register DNS records with Apache.
  431. Use this screen to register new allowed domains with your site. This
  432. process is especially important for sites using Wildcard DNS, as it prevents
  433. non-registered sites from resolving.
  434. The first domain will use the HTTP_HOST value of the request made
  435. when installing the module. This value may be edited by going to
  436. Admin > Structure > Domains and editing the Primary Domain value.
  437. The second domain will be given the value test.example.com, where
  438. example.com is the Primary Domain value. This domain is set to be
  439. 'inactive' initially. You will need to edit this domain record in order to
  440. use it.
  441. When you create a new domain record, simply fill in the form:
  442. - Domain
  443. This is the full path.example.com, without http:// or a trailing slash.
  444. - Site name
  445. This is the name of the site that will be shown when users access this site.
  446. -- Domain URL scheme
  447. Allows the domain to use 'http' or 'https' as the URL scheme. Default is
  448. 'http'. All links and redirects to the domain will use the selected scheme.
  449. -- Domain status
  450. By default, all domains are Active and anyone can navigate to them. Setting
  451. a domain to Inactive restricts access to users with the 'access inactive
  452. domains' permission. This feature is useful for staging content and testing
  453. new domain configurations.
  454. NOTE: Users who try to access an inactive domain will have the attempt
  455. reported in the site logs. When this occurs, the module will try to redirect
  456. the user to the appropriate content on an active domain. If no match is
  457. found, the user is send to the default home page.
  458. Both the Domain and the Site name are required to be unique values.
  459. After you create a record, you may edit or delete it as you see fit.
  460. NOTE: As a result of module installation, you will never have a Domain with
  461. the domain_id of 1 if you did not use Domain Access prior to 6.x.2.0. This
  462. is by design and will not affect the module.
  463. NOTE: When editing a domain record, Domain Access runs an http request
  464. to see if the domain is responding properly. This test checks for the presence
  465. of the file '200.png' inside the module's 'test' directory.
  466. If a 200 "found" reply is not returned, you will see an message warning you
  467. that your DNS may not be configured properly. This message is intended
  468. to help you debug your DNS configuration and may be safely ignored.
  469. NOTE: Users who attempt to access an unregistered domain will be
  470. redirected to the primary domain automatically.
  471. ----
  472. 4.2.1 Restricted Characters in Domains
  473. When creating a domain record, you are restricted to the valid character set
  474. for Internet domain names. By design, this includes only the ASCII
  475. alphanumeric character set (a-z 0-9) plus the special characters dot (.)
  476. dash (-) and colon (:). A colon may only be followed by a port number.
  477. Domains must be lowercase. Domain matching with HTTP_HOST is not
  478. case-sensitive.
  479. With the advent of Internationalized Domain Names (IDNs), domain servers
  480. are beginning to recognize non-ASCII domain names. To enable support for
  481. non-ASCII domain names, you must add the following lines to the bottom
  482. of your settings.php file:
  483. // Allow registration of non-ASCII domain strings.
  484. $conf['domain_allow_non_ascii'] = TRUE;
  485. For background, see the following:
  486. http://tools.ietf.org/html/rfc819
  487. http://tools.ietf.org/html/rfc1035
  488. http://en.wikipedia.org/wiki/Internationalized_domain_name
  489. http://blog.icann.org/2010/05/idn-cctlds/
  490. ----
  491. 4.2.2 Altering Domain Name Validation
  492. If you wish to enforce special business rules for domain name validation,
  493. you may implement hook_domain_validate_alter() in your module.
  494. This hook will allow your module to intercept and alter any errors found
  495. by the normal domain validation process. See domain.api.php for details.
  496. ----
  497. 4.3 Domain Module Behaviors
  498. These options affect the basic options for how the module behaves.
  499. ----
  500. 4.3.1 New Content Settings
  501. Defines the default behavior for content added to your site. By design, the
  502. module automatically assigns all content to the currently active domain.
  503. If this value is set to 'Show on all sites,' then all new content will be
  504. assigned to all sites _in addition to_ the active domain.
  505. If you set this value to 'Only show on selected sites,' you must configure
  506. the Node type settings described in section 4.8.2.
  507. ----
  508. 4.3.2 Debugging Status
  509. If enabled, this will append node access information to the bottom of each
  510. node. This data is only viewable by uses with the 'Set domain access status for
  511. all content' privilege. It is provided for debugging, since 'adminiseter nodes'
  512. will make all nodes viewable to some users.
  513. ----
  514. 4.3.3 Enforce Rules on Administrators
  515. When using Node Access modules, user 1 (the super-admin) and users with
  516. the 'Bypass content access control' permission are not subject to node access
  517. rules. This is a design feature of Drupal, and it can lead to confusion when
  518. viewing your site as an administrator.
  519. To help with this confusion, the 'Enfore rules on adminstrators' setting can
  520. be enabled. This setting forces Domain Access rules to be applied _even to
  521. users who can Bypass content access control_.
  522. The default setting is OFF, but if you regularly login as user 1 or a user with
  523. the 'Bypass content access control' permission, you may want to enable this
  524. feature.
  525. NOTE: This feature _only_ applies Domain Access rules. if you are using
  526. multiple node access modules, not all rules will be applied.
  527. ----
  528. 4.3.4 Sort Domain Lists
  529. Both the Domain Switcher block and the Domain Nav module provide an
  530. end-user visible list of domains. The domain sorting settings control how
  531. these lists are generated and presented to the user.
  532. ----
  533. 4.3.5 Domain Selection Format
  534. Controls the form element display when choosing a list of domains. By
  535. default, Domain Access shows checkboxes, but if your site has a large
  536. number of domains, checkboxes hinder usability. You may use this setting
  537. to force domain lists to be displayed as multiple select lists instead.
  538. By default, if you have more than 25 domains, a select list will be used
  539. for your forms, but you may use this setting to alter that behavior.
  540. ----
  541. 4.4 Advanced Settings
  542. These settings control advanced features for the module. Some of these
  543. features require patches to Drupal core. Please read the documentation
  544. carefully before implementing these features.
  545. NOTE: Some of these options may be disabled in the event that patches
  546. have not been applied.
  547. By default, these features are all disabled.
  548. ----
  549. 4.4.1 Search Settings
  550. Allows the admin to decide if content searches should be run across all
  551. affiliates or just the currently active domain. By design, Drupal will only
  552. find matches for the current domain.
  553. ----
  554. 4.4.2 Search Engine Optimization
  555. There is a risk with these modules that your site could be penalized by search
  556. engines such as Google for having duplicate content. This setting controls the
  557. behavior of URLs written for nodes on your affiliated sites.
  558. - If SEO settings are turned on, all node links are rewritten as absolute
  559. URLs.
  560. - If assigned to 'all affiliates' the node link goes to the 'default source
  561. domain' defined in 4.4.3. Normally. this is your primary domain.
  562. - If assigned to a single affiliate, the node link goes to that affiliate.
  563. - If assigned to multiple affiliates, the node link goes to the first
  564. matching domain.
  565. (Determined by the order in which domains were created, with your primary
  566. domain matched first.)
  567. The optional Domain Source module (included in the download) allows you to
  568. assign the link to specific domains.
  569. ----
  570. 4.4.3 Default Source Domain
  571. This setting allows you to control the domain to use when rewriting links that
  572. are sent to 'all affiliates.' Simply select the domain that you wish to use as
  573. the primary domain for URL rewrites.
  574. NOTE: This option only fires if you enable SEO rewrites or use the provided
  575. Domain Source module.
  576. By default this value is your primary domain.
  577. ----
  578. 4.4.4 WWW Prefix Handling
  579. This setting controls how requests to www.example.com are treated with
  580. respect to example.com. The default behavior is to process all host names
  581. against the registered domain list.
  582. If you set this value to 'Treat www.*.example.com as an
  583. alias of *.example.com' then all host requests will have the 'www.' string
  584. stripped before the domain lookup is processed.
  585. Users going to a www.one.example.com in this case will not automatically
  586. be sent to one.example.com, but your Drupal site will behave as if they
  587. had requested one.example.com.
  588. This feature was requested by Rick and Matt at DZone.com
  589. ----
  590. 4.5 Special Page Requests
  591. For this feature to work, you must follow the instructions in INSTALL.txt
  592. regarding custom_url_rewrite_outbound(). If you have not followed the
  593. instructions, you should see a warning at the top of the Admin > Structure >
  594. Domains page.
  595. In normal uses, such as the default home page, you want to restrict access
  596. to content based on the active domain. However, in certain cases, this
  597. behavior is not desired.
  598. Take the Track page for each user, for example. The Track page is at
  599. 'user/UID/track' and shows a list of all posts by that user. By design, this
  600. page may show different results if seen from different domains:
  601. -- one.example.com/user/1/track
  602. Shows all posts by user 1 assigned to the domain one.example.com
  603. -- two.example.com/user/1/track
  604. Shows all posts by user 1 assigned to the domain two.example.com
  605. The behavior we really want is to show ALL posts by the user regardless of
  606. the active domain.
  607. The Special Page Requests setting lets you specify Drupal paths for which
  608. this behavior is active. These paths are entered in the same way as block
  609. settings for page visibility.
  610. Some sample pages that might require this setting. Note, some of these
  611. are contributed modules:
  612. -- user/*/track
  613. -- blog/* -- the user blog page
  614. -- mysite/* -- the MySite module
  615. -- popular/alltime -- a View page
  616. -- popular/latest -- a View page
  617. -- taxonomy/term/* -- to show all taxonomy terms at all times
  618. -- taxonomy/term/10 -- to show only term 10 at all times
  619. -- taxonomy/term/*/feed/* -- all taxonomy term feeds
  620. Default and custom Views are often good candidates here as well.
  621. By default, 'user/*/track' is in this list.
  622. The logic for how these links are written is documented in 4.4.2 Search Engine
  623. Optimization.
  624. Note that the 'search' path is handled separately and need not be added here.
  625. ----
  626. 4.5.1 Cron Handling
  627. When Drupal's cron function runs, it runs on a specific domain. This forces
  628. Domain Access to invoke its access control rules, which may not be desired.
  629. In most use cases, you will want Domain Access to allow access to all nodes
  630. during cron runs. For modules such as Subscriptions, this behavior is
  631. required unless all your content is assigned to "all affiliates."
  632. To reflect this, Domain Access provides a configuration option labelled:
  633. [x] Treat cron.php as a special page request
  634. This option is turned on by default. In almost all cases, you should leave
  635. this option checked. Doing so allows Domain Access to ignore access checks
  636. for nodes when cron runs.
  637. Note that this does not affect node access permissions set by other modules.
  638. ----
  639. 4.5.2 XMLRPC Handling
  640. Similar to the above, you may check this option to disable Domain Access
  641. rules when Drupal is invoked using XMLRPC.
  642. ----
  643. 4.6 Node Link Patterns
  644. When using this module, there are times when Domain Access will need to
  645. rewrite a node link using custom_url_rewrite_outbound().
  646. Since Drupal is an extensible system, we cannot account for all possible
  647. links to specific nodes. Node Link Patterns are designed to allow you to
  648. extend the module as you add new contributed modules.
  649. By default, the following core link paths will be rewritten as needed.
  650. -- node/%n
  651. -- comment/reply/%n
  652. -- node/add/book/parent/%n
  653. -- book/export/html/%n
  654. -- node/%n/outline
  655. Where %n is a placeholder for the node id.
  656. If you install additional modules such as Forward
  657. (http://drupal.org/project/forward)
  658. or Print
  659. (http://drupal.org/project/print)
  660. you will want to add their paths to this list:
  661. -- forward/%n
  662. -- print/%n
  663. This is an advanced, but necessary feature. Please report any core node path
  664. omissions at http://drupal.org/project/issues/domain.
  665. ----
  666. 4.7 Domain List
  667. This screen shows all active domains registered for use with the site.
  668. Record zero (0) is hardcoded to refer to the "root" site defined as your
  669. Primary domain name.
  670. ----
  671. 4.8 Node Settings
  672. The Node settings page is divided into two parts, each with a different purpose.
  673. ----
  674. 4.8.1 Domain Node Editing
  675. The top section 'Domain node editing' is required for those sites that use the
  676. advanced editing techniques outlined in section 3.
  677. For users without the 'Administer content' permission, certain elements of the
  678. node editing form are hidden. These settings allow the site administrator to
  679. enable users with the 'Edit any content on assigned domains' permission to have
  680. access to those restricted fields.
  681. By default, 'Comment settings', 'Delete node', 'Publshing options', and 'Path
  682. aliasing' are enabled.
  683. ----
  684. 4.8.2 Domain Node Types
  685. The lower section 'Domain node types' is used to extend the 'New content
  686. settings' described in 4.1.
  687. Domain node types presents a list of all active node types on your site. By
  688. checking the box, nodes for that given type will automatically be assigned to
  689. 'all affiliate sites' during node creation and editing.
  690. ----
  691. 4.9 Batch Updating
  692. The module provides for batch actions for common tasks. These actions are
  693. useful for making rapid changes across all domains. The following actions
  694. are available by default.
  695. - Edit all domain values
  696. - Edit all site names
  697. - Edit all URL schemes
  698. - Edit all domain status flags
  699. Additional batch actions are made available for the Domain Configuration
  700. module. Other modules may implement hook_domainbatch() to provide
  701. additional batch actions.
  702. It may be necessary to enter the batch form from the primary domain.
  703. For some settings, you may see an 'Update value for all domains' section
  704. of the form. You may use this value to reset all domains to the same
  705. setting. This option is not available for settings that must be unique
  706. per domain, such as the domain string.
  707. For global settings to apply, you must check the 'Apply to all domains'
  708. box before submitting the form.
  709. ----
  710. 4.10 Assigning Users to Domains
  711. New in 6.x.2 is the concept of 'user defaults.' These settings are used to
  712. assign users to domains basd on the user's site roles.
  713. Click on the 'User defaults' tab to see the settings available.
  714. By design, these settings are always added to a user's domains when a page
  715. is requested. That is, if you assign all 'authenticated users' to your first
  716. domain, one.example.com, then all authenticated users will be assigned to that
  717. domain.
  718. This setting is most useful under the following conditions:
  719. -- If you let anonymous users post content on your site. In this case, you
  720. should assign at least one domain to the anonymous user role, so that
  721. the module will assign anonymous posts to the appropirate domain(s).
  722. -- If you use Domain Strict, you can use this setting to assign default
  723. access to specific roles.
  724. Note that there are two options for how this setting behaves:
  725. -- Add default roles dynamically [default]
  726. This setting is the normal use and does not write individual records to the
  727. {domain_editor} table. Use this setting if you want to change options for
  728. each role quickly, as these are global settings, so taking away a domain
  729. will instantly apply to all users.
  730. -- Add default roles to the user account
  731. Use this setting if you want to automatically register users to specific
  732. domains or to save changes to a batch of users. When this setting is
  733. active, domain assignments are saved permanently to the {domain_editor}
  734. table and can only be removed by editing the user account.
  735. You may also assign default domains for all new users of your site. To do
  736. so, simply select the domains that new users should be assigned to. If you
  737. make no selection, new users will automatically be assigned to the domain
  738. from which they enter the registration form.
  739. Settings for the 'new user' are permanently saved to the user account.
  740. See http://drupal.org/node/313629 for some background about this feature.
  741. ----
  742. 4.11 Batch Assignment of Users to Domains
  743. In 6.x.2 and higher, users with the 'administer users' and 'assign domain
  744. editors' permissions may use the User administration page to batch assign
  745. users to domains.
  746. This feature is useful if you need to convert a group of editorial users to
  747. become domain editors.
  748. To use this feature, navigate to Administer > User management > Users.
  749. Look for the 'Assign users to domains' option in the 'Update options' select
  750. form. Choose this operation and then use the 'Affiliate editor options'
  751. fieldset to select the domains you wish to assgin users to.
  752. Select the desired users and hit the Update button.
  753. Note that this form also shows you a list of domains that a user is
  754. currently assigned to.
  755. If these elements do not appear, you do not have the proper permissions.
  756. ----
  757. 4.11.1 Form Behavior
  758. In 6.x.2.5 and higher, you may select one of two options when updating domains.
  759. Under the 'Update behavior' form element, you may choose:
  760. [] Replace old values with new settings
  761. [] Add new settings to existing values
  762. [] Remove selected domains from existing values
  763. Choosing 'replace' will erase any current domain affiliation for the selected
  764. users and replace them with those entered into the form. Choosing 'add' will
  765. merge the new values with the existing values. Choosing 'remove' will remove the
  766. new values from the existing ones.
  767. This new feature is helpful when you want to alter domain settings, but do not
  768. want all users to be assigned to the same domains.
  769. ----
  770. 5. Blocks
  771. The Domain Access module provides two blocks, which can be used to help you
  772. debug your use of the module.
  773. ----
  774. 5.1 Block -- Domain Switcher
  775. The Domain Switcher block presents a list of all active domains. Clicking
  776. on one of the links will take you from your current URL to the same URL on
  777. the selected domain.
  778. For example, if you are looking at example.com/?q=node and click on another
  779. domain, the link will take you to one.example.com/?q=node.
  780. In the Domain Switcher block, domains are listed using their human-readable
  781. sitename variables.
  782. NOTE: This block is for debugging purposes. The included Domain Navigation
  783. module provides block and menu items intended for end users.
  784. ----
  785. 5.2 Block -- Domain Access Information
  786. The Domain Access Information block lets you view node access rules for any
  787. node when you are viewing that node. This block can help you debug the
  788. module for user accounts that do not have the 'Set domain access status for all
  789. content' permission.
  790. NOTE: By design, this block is viewable by all users. However, its content
  791. should only be shown to site developers or during debugging. You should use
  792. the normal block visiblity settings as appropriate to your site.
  793. ----
  794. 5.3 Block -- Domain Access Server Information
  795. Provides a block of information related to the current page request. Use this
  796. block to help determine how a server request is being handled by Domain Access.
  797. If you are having trouble with domains not resolving correctly, this block can
  798. help you pinpoint the problem. In particular, note the first two lines of the
  799. output:
  800. HTTP_HOST request example.com
  801. Domain match TRUE
  802. The first line tells you what HTTP_HOST (i.e. the domain string) was passed by
  803. the server to Drupal. The second line indicates how Domain Access reads that
  804. value.
  805. Possible replies for the 'Domain match' value are:
  806. TRUE
  807. Indicates a matching domain record.
  808. FALSE: Using default domain
  809. Indicates a non-matching domain, and that Domain Access is using the
  810. default domain as a fallback.
  811. ALIAS: Active id #
  812. Used when Domain Alias is installed. Indicates that the request matched a
  813. known alias of the active domain.
  814. Below the Domain match line, you will see additional information about the
  815. current $_domain global object.
  816. NOTE: By design, this block is viewable by all users. However, its content
  817. should only be shown to site developers or during debugging. You should use
  818. the normal block visiblity settings as appropriate to your site.
  819. ----
  820. 6. Node Access
  821. The Domain Access module is a node_access() module. For additional developer
  822. information, see http://api.drupal.org/api/group/node_access/5.
  823. By design, the module sets access to content based on the current domain that
  824. a user is viewing. If a user is at one.example.com, they can see content that
  825. is assigned to that domain or to all domains.
  826. ----
  827. 6.1 Assigning Domain Access
  828. Users who have the 'Set domain access status for all content' permission can
  829. assign any node to any or all registered sites. During node editing, a series
  830. of options will be displayed as checkboxes or a multiple select list under the
  831. heading "Domain access options":
  832. Publishing options:
  833. [] Send to all affiliates
  834. Select if this content can be shown to all affiliates. This setting will
  835. override the options below.
  836. Publish to: * (required)
  837. [] Drupal
  838. [] One site
  839. [] Two site
  840. Select which affiliates can access this content.
  841. If you select 'Send to all affiliates,' the node will be viewable on all domains
  842. for your site. Even if you select this option, you must select at least one
  843. domain for the node.
  844. If you do not select at least one option, the module will automatically
  845. assign the node to your default domain.
  846. When creating new content, the currently active domain will be selected for you.
  847. For users who do not have the 'Set domain access status for all content' permission, the assignment
  848. will be done through a hidden form element. The node will be assigned to the
  849. currently active domain or, if configured , to all domains.
  850. ----
  851. 6.2. Editor Access
  852. Whenever a user account is created and the Domain Access module is active, user
  853. accounts will automatically be tagged with the name of the active domain from
  854. which they registered their account. Users with the 'Set domain access status
  855. for all content' permission may assign individual users to specific domains in
  856. the same way that nodes can be defined.
  857. These user settings are used to determine what domains an editor belongs to.
  858. Users with the 'Edit any content on assigned domains' permission can edit any
  859. node that belongs to the same domain that the user does. (Remember that users
  860. and nodes can both belong to multiple domains.) However, nodes that are
  861. assigned to 'all affiliates' do not grant editing privileges to all editors.
  862. ----
  863. 6.3 Realms
  864. This section contains technical details about Drupal's node access system.
  865. In Domain Access, the following realms are defined:
  866. - domain_all
  867. Indicates whether the view grant should be passed for all nodes on
  868. a given page request. Used in cases such as Search and MySite to
  869. enable aggregation of content across affiliates. The only valid nid
  870. and gid for this grant are zero (0).
  871. - domain_site
  872. Indicates whether a node is assigned to all affliaites. The only valid
  873. grant id for this realm is zero (0).
  874. - domain_id
  875. Indicates that a node belongs to one or more registered domains. The
  876. domain_id key is taken from the {domain} table and is unique.
  877. ----
  878. 6.4 Grants
  879. In each of the realms, there are specific rules for node access grants, as
  880. follows.
  881. - domain_all
  882. In some specific cases, like Search or the user's Tracker page we want people
  883. to be able to see content across all affiliates. Only the domain_all grant is
  884. assigned in these cases. This grants only 'grant_view'.
  885. - domain_site
  886. By design, all site users, including anonymous users, are granted access to
  887. the gid '0' for realm 'domain_site'. This grant allows all users to see
  888. content assigned to 'all affliates'. This grants 'grant_view' to all users.
  889. Users who belong to the current domain and are assigned the
  890. 'Edit any content on assigned domains' or 'Delete any content on assigned
  891. domains' permissions will be given 'update' and 'delete' grants, respectively.
  892. - domain_id
  893. When a user, including anonymous users, views a page, the active domain is
  894. identified by the registered domain_id. For that page view, the user is
  895. granted gid of the active domain_id for the realm 'domain_id'. This allows
  896. content to be partitioned to one or many affilaites. This grants only
  897. 'grant_view', since 'grant_edit' would allow content to appear to some users
  898. regardless of the active domain.
  899. ----
  900. 6.5 Warnings
  901. Node access in Drupal is a permissive system. Once a grant has been issued, it
  902. cannot be revoked. As a result, it is possible for multiple editors to be able
  903. to edit or delete a single node. Here's the use case:
  904. - Node 10 (a book page) is assigned to one.example.com and three.example.com
  905. - User A is an editor for one.example.com.
  906. - User B is an editor for two.example.com
  907. - User C is an editor for three.example.com
  908. Under this scenario, User A and User C will be able to edit node 10.
  909. To be more clear about Drupal permissions:
  910. - User D has 'Bypass content access control' permission for the site.
  911. - User E has the 'Book page: edit all content' permission for the site.
  912. In this case, User D and User E can also edit or delete node 10. This is why
  913. only super-admins are given 'Bypass content access control' and 'TYPE: edit all
  914. content' permissions with the Domain Access module. If you want your affiliate
  915. editors to have limited permissions, only grant them 'Edit any content on
  916. assigned domains'.
  917. However, you still need to give users the 'TYPE: Create new content' permission
  918. normally. Domain Access does not affect node creation.
  919. Since Domain Access implements node_access() fully, if you uninstall the module
  920. -- using Drupal's uninstall sequence -- all node_access entries should be reset
  921. to grant 'grant_view' to realm 'all' with gid '0'.
  922. ----
  923. 7. Developer Notes
  924. The Domain Access module is meant to be the core module for a system of small
  925. modules which add functionality.
  926. ----
  927. 7.1 Extension Modules
  928. Currently, the following modules are included in the download. They are not
  929. required, but each adds functionality to the core module.
  930. - Domain Alias -- Allows advanced handling of domain name matching. Use
  931. this module to treat multiple domains as though they were identical.
  932. - Domain Configuration -- Allows you to change select system variables for
  933. each domain, such as offline status, footer message and default home
  934. page.
  935. - Domain Content -- Provides a content administration page for each domain,
  936. so that affiliate editors can administer content for their section of the
  937. site.
  938. - Domain Navigation -- Supplies a navigation block with three themes. Creates
  939. menu items for each domain, suitable for using as primary or secondary
  940. links.
  941. - Domain Prefix -- A powerful module that allows for selective table prefixing
  942. for each domain in your installation.
  943. - Domain Source -- Allows editors to specify a primary "source" domain to be
  944. used when linking to content from another domain.
  945. - Domain Strict -- Forces users to be assigned to a domain in order to view
  946. content on that domain. Note that anonymous users may only see content
  947. assigned to "all affiliates" if this module is enabled.
  948. - Domain Theme -- Allows separate themes for each domain.
  949. - Domain User -- Allows the creation of specific subdomains for each active
  950. site user.
  951. - Domain Views -- Provides a Views filter for the Domain Access module.
  952. ----
  953. 7.2 The $_domain Global
  954. NOTE: In Drupal 7, this value is deprecated. You should use domain_get_domain()
  955. to return the active domain.
  956. During hook_init(), the Domain Access module creates a new global variable,
  957. $_domain, which can be used by other Drupal elements (themes, blocks, modules).
  958. The $_domain global is an array of data taken from the {domain} table for the
  959. currently active domain. If no active domain is found, default values are used.
  960. $_domain['domain_id'] = 0;
  961. $_domain['sitename'] = variable_get('domain_sitename',
  962. variable_get('site_name', 'Drupal'))
  963. $_domain['subdomain'] = variable_get('domain_root', '')
  964. $_domain['scheme'] = 'http'
  965. $_domain['valid'] = TRUE
  966. $_domain['path'] = http://example.com
  967. $_domain['error'] = ''
  968. Some uses for this global variable might include:
  969. - Block placement based on active domain (using PHP for block visibility).
  970. - Ad tags inserted based on active domain.
  971. - Theme switching based on domain.
  972. The 'error' element is new in 6.x.2 and is used to signal installation problems.
  973. Normally the 'error' element should not be set. See the API documentation of
  974. hook_domain_bootstrap_ful() for details.
  975. ----
  976. 7.3 Database Schema
  977. The Domain Access module creates two tables in a Drupal installation. {domain}
  978. contains the following structure:
  979. - domain_id
  980. Integer, unique, auto-incrementing.
  981. The primary key for all domain records.
  982. - subdomain
  983. Varchar, 80, unique (enforced by code)
  984. 'Domain' is a sql-reserved word, so subdomain is used. This value must match
  985. the url 'host' string derived from parse_url() on the current page request.
  986. - sitename
  987. Varchar, 80, unique (enforced by code)
  988. The name for this affiliate, used for readability.
  989. - scheme
  990. Varchar, 8 default 'http'
  991. Indicates the URL scheme to use when accessing this domain. Allowed values,
  992. are currently 'http' and 'https'.
  993. - valid
  994. Char, 1 default 1
  995. Indicates that this domain is active and can be accessed by site users.
  996. The {domain_access} table is a partial mirror of the {node_access} table and
  997. stores information specific to Domain Access. Its structure is:
  998. - nid
  999. Integer, unsigned NOT NULL default '0,
  1000. - gid
  1001. Integer, unsigned NOT NULL default '0'
  1002. - realm
  1003. Varchar, 255 NOT NULL default ''
  1004. The {domain_editor} table stores information about which users can edit and
  1005. delete content on specific domains. Its structure is:
  1006. - uid
  1007. Integer, unsigned NOT NULL default '0,
  1008. A foreign key to the {users} table.
  1009. - domain_id
  1010. Integer, unsigned NOT NULL default '0'
  1011. A foreign key to the {domain} table.
  1012. ----
  1013. 7.4 API
  1014. The Domain Access module has an API for internal module hooks. Documentation is
  1015. included in the download as domain.api.php and can be viewed online at:
  1016. http://therickards.com/api
  1017. The most important developer functions are the internal module hooks:
  1018. http://therickards.com/api/group/hooks/Domain
  1019. ----
  1020. 7.5 drush and Domain Access
  1021. Using drush, treat a Domain Access site like a multi-site install. If you do
  1022. not supply a URI flag, drush may get confused and throw an error.
  1023. Enter drush commands in the format:
  1024. >> drush --uri=www.example.com NORMAL COMMAND
  1025. Generally, use the primary domain as the --uri flag.
  1026. ----
  1027. 7.6 Domain Tokens
  1028. The module provides the following replacement tokens.
  1029. 'current-domain:id'
  1030. The current domain ID.
  1031. 'current-domain:name'
  1032. The current domain name, lowercased and with only alphanumeric characters.
  1033. 'current-domain:url'
  1034. The current domain's URL, lowercased and with only alphanumeric characters.
  1035. 'current-domain:subdomain'
  1036. The current subdomain, lowercased and with only alphanumeric characters.
  1037. Only works with *.example.com formats
  1038. 'default-domain:id'
  1039. The default domain ID.
  1040. 'default-domain:name'
  1041. The default domain name, lowercased and with only alphanumeric characters.
  1042. 'default-domain:url'
  1043. The default domain\'s URL, lowercased and with only alphanumeric characters.
  1044. 'default-domain:subdomain'
  1045. The default subdomain, lowercased and with only alphanumeric characters.
  1046. Only works with *.example.com formats