If you want to change the current domain name in DirectAdmin to a new domain you can change this using DirectAdmin. In this article we explain how you can change the domain and how you can redirect the old domain to the new domain. This is useful for SEO and visitor purposes.
1. Log in to DirectAdmin
Navigate in the client area to Services -> My services and click on the corresponding service. Scroll down and click on DirectAdmin the "Log In To" area.
2. Domain setup/manager
If you have multiple domains, click on the button Domain Administration. If you have one domain, click on Domain Setup.
3. Click on "Change a Domain Name"
4. Select the old domain the dropdown and enter the new domain in the textfield.
5. Click on Change.
Point the old domain to the new domain
For SEO and visitor purposes, it is recommended to maintain the old domain for a few months at least (longer if possible) to make sure that your visitors and search engines find the new domain. This step is optional and is not necessary if the website is not listed in Google and when there are no visitors yet.
1. Click on Home.
2. If you have multiple domains, click on the just changed domain.
3. Click on Domain Pointers.
4. Enter the old domain in the textfield.
5. Make sure that "Create as an Alias" is checked.
6. Click on Add.
7. Click on Files.
8. Navigate to domains/yourdomain.com/public_html
9. Create or open the .htaccess file
10. Add the following (replace www.yourdomain.com with your domain) to the .htaccess file
Note: this will redirect all traffic to www.yourdomain.com. If an user visits yourdomain.com (without www.), he/she will get redirected as well. Make sure that your application works with www.yourdomain.com before you configure this setting.
RewriteEngine On RewriteCond %{HTTP_HOST} !^www.yourdomain.com$ [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
11. Do the same for domains/yourdomain.com/private_html if that folder is not linked with the public_html folder.
Troubleshooting
Domain change
It may take up to two minutes until the domain change has been processed.
Domain redirect
If you get a continuous redirect we advice to change the .htaccess to remove the www. if it was there or to add www. if it was not there. If this does not help, remove the .htaccess rules and contact us for help.