: 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),
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?
More posts by @Alves908
1 Comments
Sorted by latest first Latest Oldest Best
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]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.