Mobile app version of vmapp.org
Login or Join
Alves908

: How to do a 301 redirect in DirectAdmin & WordPress? In the past, our company had only one domain (www.domain_old.com) which obviously was the main domain. Now we have bought a new domain (www.domain_new.com),

@Alves908

Posted in: #301Redirect #ControlPanel #Wordpress

In the past, our company had only one domain (www.domain_old.com) which obviously was the main domain. Now we have bought a new domain (www.domain_new.com), which we'd like to be the main domain from now on (i.e., for all the webpages, subdomains, emails, etc...). In other words:


domain_old.com --> domain_new.com

Answers to similar questions on this site suggest using a 301 redirect, so I assume that's the best option.

Our website uses DirectAdmin and WordPress; how can I add a 301 redirect for the old_domain to the new_domain using these?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

Here is a forum on the DirectAdmin website where they tell you how to edit the .htaccess file through DirectAdmin:


You can edit it through the Filemanager in DA, you'd just have to type it in manually. ex:

domain.com:2222/CMD_FILE_MANAGER/domains/domain.com/public_html/.htaccess?action=edit

Once you can edit your .htaccess file you can add a redirect:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.domain-new.com$ [NC]
RewriteRule ^(.*)$ www.domain-new.com/ [R=301,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme