How to Redirect a Domain on a Linux Server by Using the 301 Redirect Approach
You need to keep in mind that the following 301 redirect approach will not work unless the Linux server has the Apache ModRewrite module on. So, make sure to consult with your server administrator about whether or not the server has the module turned on. Usually, this functionality is turned on automatically, but you won’t lose anything if you consult anyway.
So, you need to make a .htaccess file in the core directory of your old domain or edit the .htaccess file that is already there. You need to add these exact lines:
- Options + FollowSymLinks
- RewireEngine on
- RewriteRule (.*) http://www.yournewdomain.com/$1 [R-301,L]
Upload the new .htaccess file and every visitor that will come to your website will be redirected to your new domain.
How to Redirect a Domain on a Windows Server by Using the 301 Redirect Approach
You need to access the Internet Service Manager on the server and then right-click on the website that you want to redirect visitors from. Select Properties and after that select Home Directory.
You should be able to see the window Default Web Site Properties and the tab Home Directory at the center.
You need to select:
- A redirection to a URL
- Redirect to field type of your new domain you want to send the visitors to
- Choose A Permanent Redirection For This Source
- Press OK
That’s it. This is everything you need to do in order to redirect an old domain to a brand new domain on a Windows server by using the 301 redirect approach.
We hope that this article was helpful for you!