Redirecting one website to another is certainly not a new idea; people have been learning how to do this for as long as the internet has been popular. Whether your company is rebranding with a new domain, you are changing a personal blog from one property to another, or simply restructuring your existing website’s layout, you will need to use redirects in order to ensure those visiting the old site or path are automatically brought to the new location.
What is a 301 redirect?
There are a variety of ways of redirecting visitors from one domain or page to another. 301 redirects are the style of HTTP redirect that is both user and search engine friendly. 301 redirects are a signal to search engines that a particular website or page has moved permanently to another URL. For example, if you were rebranding your old business (oldbusiness.com) to new business (newbusiness.com) you would want to forward the old domain to the new one using a 301 redirect.
Note that if you’re not 100% sure of the need for the redirect, you may wish to set it up as a 302 redirect first, then make it ‘permanent’ (301) later. I believe 302s are only possible with a manual redirect as described below.
How to create a 301 redirect
If you’re forwarding an entire domain to another (like mydomain.com to mynewdomain.com), the simplest way to do this in Plesk 11.5 and newer is to simply add it as a domain alias — Plesk will automatically ensure that it sets up a 301 redirect for you.
Redirecting a Domain to another Domain you host
- Login to Plesk and choose the Add Domain Alias button
- Enter the domain you wish to forward and then select the domain you wish to forward it to
- Leave all check boxes at their defaults. If you do not wish to forward mail, uncheck the “Mail Service” box.
- Choose the OK button to save your settings
Your domain -> domain redirect is now in place.
Redirecting a Domain to any URL
- If you have not yet added the domain in Plesk, login to Plesk and choose the Add Domain button, enter the domain name, then if you see the option to select the “Hosting Type”, select Forwarding
- If the domain already exists in Plesk or if you did not see the option to select the “Hosting Type” in step 1, find your domain in the list in Plesk, then click “Hosting Settings“. Look just below the domain name and you’ll see “Hosting Type” with a link to change it. Click that link and you’ll be presented with the option to select Forwarding (do that)
- Enter the destination URL
- Choose the forwarding type / response code. Be sure to select carefully. If there’s any point in the future where you may wish to remove this forward, it’s recommended to choose “Moved Temporarily,” otherwise you should choose “Moved Permanently”. Frame forwarding is typically not recommended.
- Click OK to save your settings.
Your domain -> URL redirect is now in place.
Redirecting a Subdomain
If you’d like to forward a subdomain to another URL, here’s how to do so in Plesk 11.5 and newer:
- Login to Plesk and choose the Add Subdomain button
- Enter your subdomain and leave the default settings as is.
- Press OK to create the subdomain
- Under the Subdomain’s settings, choose Hosting Settings
- Look for “Hosting type” then select the Change link beside “Website”
- In the drop down menu beside “Hosting Type” choose Forwarding
- Enter the destination address and Press OK to save the settings.
Your subdomain -> URL redirect is now in place.
You’ll want to set up a manual redirect if you wish to redirect one URL to another such as mydomain.com/subfolder to mydomain.com/newfolder. Many content management systems like WordPress have great plugins to do this for you.
If you’re not using a CMS like WordPress, or if you’re using an older version of Plesk that doesn’t create redirects for you, create the redirects manually by reading on!
In the following video we will be looking at using the htaccess file within Plesk 9 to create 301 redirects, however Plesk 10 and 11 both have a file manager that behaves very similar to the one in Plesk 9.
Remember that whenever you are moving one domain to another, you should put some sort of redirect in place. If it is a permanent move, that should be a 301 redirect.
Feel free to use the following lines (but edit them!) if you are setting up your own .htaccess 301 redirects:
redirect 301 / http://www.yournewsite.com/ redirect 301 /oldpage/ http://www.yoursite.com/newpage/ redirect 301 /oldpage.html http://www.yoursite.com/newpage/
Let us know if you have any questions!