There was a problem loading the comments.

How to create a domain redirect in DirectAdmin

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

When creating a domain redirect, you have two options.

If you are simply pointing domain1.com to domain2.com, you can use the in-built "Site Redirection" feature.

2b2e5156c1787422aeac693eab79727c98693d2c480e47f482b6dc0fade5dc646d8287a6f1bfa55b?t=f07a0d31be4628f01d068e5a6dc93858

Simply create a new Redirect and enter the new domain.

 

However, if you need to create a domain redirect where domain1.com/login needs to point to domain2.com/login (and any other directory/file beyond the top level domain), then you can use a .htaccess file instead.

 

Go to "System Info & Files", then click "File Manager" - find the domain that you want to create a redirect for.

 

Right-click and press "Create File"

d6c0f32a9e9aa92c72fad17b198bd693ae8e544060049fd4f930a6fe689822dfd50ff469bf96fdcd?t=9921beefa2bd17394c112a2bb79259da

Name it ".htaccess" (the leading dot is important)

ff384dc9f5ba0c7c3046eb2901ed0d33631d64ff36a4ee552f82a6f3694b8d4c1ee9c2ff4feb7b71?t=287cf059200ad474a0186f8990e354d0

 

Within this file, paste the following code (replacing the original/destination domains with your own).

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
RewriteRule ^(.*)$ http://domain2.com/$1 [L,R=301]

 

If you require any assistance, please contact our support team.


Share via

Related Articles

© Zarro Technology