How Do I Change a Site's Host Name / Domain Name?

Drupal Version


Below is a quick summary of what you need to do if you are changing your Drupal site's host name / domain name without moving it to a new web hosting location.

If you are moving the site to another location, then you'll also need to see the Site Migration section for additional guides.


  1. First, go ahead and request that your new host name be created in DNS and pointed to your existing web server.  You'll need to know the host name and/or IP address of your existing server to provide to your DNS administrator.  If you don't know either, then provide the current host name for your website, and your DNS administrator should be able to determine the web server hostname and IP address from it.

  2. Configure your web server to recognize the new host name.  If you are using an automated web hosting solution like OIT's Web Hosting, then go into your control panel and add the new host name as a domain alias for your hosting account.

  3. Check your site for links hard coded to your old host name:
    • The quickest way of doing this (though it does require some advanced knowledge) is to dump your database out to an SQL file and do a search through that file for instances of your old host name and then identify the pages that need to be updated.  
    • Alternatively, you could go through every page, opening each one up for editing, and check the page source for every inline link and every inline image.  

    If you don't fix these links, then users will be silently switched over to the old hostname when they follow those hard coded links, and when you eventually delete the old hostname from DNS, those links will simply break.

  4. If you want to force everyone to view your site through the new host name (which is important for Search Engine Optimization), you can add something like the following to your .htaccess file, where and are replaced with the appropriate values:

      RewriteCond %{HTTP_HOST} ^ [NC]
      RewriteRule ^ http%{ENV:protossl}://{REQUEST_URI} [L,R=301]