views:

18

answers:

1

I have a new client that I am converting over to Drupal from Wordpress. We have two domains with the same name but different TLDs i.e. .com & .org. We have decided to start by setting up the site first under the .com so we have a live site to play with during the development.

So we currently have a wordpress site running on the .org and drupal (on a new host) running on the .com domain.

So two questions:

  1. Can and How do you configure Drupal to work for both the .com and the .org ?
  2. Can and How do you change the base domain drupal is configured with after the site is live ?
+1  A: 

If you aren't using Drupal's multisite system (that is, the site information is being put into sites/default instead of sites/example.org or sites/example.com), this is really easy: do nothing. There is no step 2. Drupal will handle any domain thrown at it: just use your web server's name-based handling to determine which domains to accept.

If you are using Drupal's multisite system, it's a little harder:

  1. Rename the sites folder (so from sites/example.com to sites/example.org).
  2. Drupal's files table hardcodes the files directory it uses, so you're going to need to change all the paths in it. Run UPDATE files SET filepath = REPLACE(filepath,'example.org','example.com') on the database.
  3. The other place to change the path is under Site Configuration -> File system.
  4. The final place you're going to need to change paths is going to be on the settings page for your theme if you decided to use a custom logo or favicon.
  5. Once you've changed all the paths, rebuild the cache under Site Configuration -> Performance.

This should cover most cases. Check with the third-party modules you're using to see if they also hardcode filepaths. If the modules are using the API correctly, they should've been handled in steps 2 and 3.

Because of all the hardcoded file paths, I highly recommend not using multisite unless you really need to. If you are only running one site in a Drupal install, just stick the site in sites/default.

Mark Trapp
Using a multisite configuration is useful if the information that appear in the domains is different. If just want to use example.com, and example.org to show the same information, then a multisite configuration is not needed.
kiamlaluno

related questions