Sign Up / Log In
Need help?
1 213 559 2459
Online Support Windows Hosting

How to do a 301 or 302 redirect to a website for Plesk?

A website redirection is generally done so that when mydomainA.com is accessed, you are routed to the website content for mydomainB.com. You can have a 301 permanent redirect or a 302 temporary redirect.

A 301 redirect is done when you have permanently moved your website to a new address, which is your new domain name. This permanent redirection also tells search engines, e.g. Google, that you are moving from point A to point B for good. In return, search engines will allow direct ranking and value signals for the new URL, understanding that this is now the permanent home of your website content.

On the other hand, a 302 redirect is done for temporary reasons, e.g. in cases where you are doing a major maintenance for your main website and you would like to temporarily route your website visitors to a different site. This will avoid visitors from receiving an error page while your main website is currently down. Search engines will know that you have only done a temporary redirection and that the value of that page should be kept intact and should not be transferred or indexed along with the other URL.

Creating a 301/302 Redirect for Addon domains & Subdomains

Both types of redirection can be done for your addon domains and subdomains with Plesk by following these simple steps:

  1. Click Sign Up / Log In at the top of this page.
  2. Select Hosting Manager from the drop-down list.
  3. Enter your hosting username and password, then click Log In.
  4. Click Websites & Domains from the left-side menu.
  5. Look for the domain or subdomain you would like to manage.
  6. Under that domain or subdomain, click on the Hosting Settings icon.
  7. Click on the Change link for the Hosting type setting.
  8. On the Change Hosting Type page, click on the drop-down menu and select Forwarding.
  9. Enter the complete URL of the target website.
  10. Select the Forwarding type you prefer and click OK.
  11. A pop-up warning will appear, click Yes if you agree.

Congratulations! You have just done a 301/302 redirection for your addon domains and subdomains on Plesk.

Creating a 301/302 Redirect for your Primary Domain

The primary domain name is the domain that is directly hosted by your Windows Hosting and is directly connected to your Plesk panel. Both types of redirection can be done for your primary domain name using a script that you can add in your web.config file in Plesk. Refer to the instructions below to know how:

  1. Click Sign Up / Log In at the top of this page.
  2. Select Hosting Manager from the drop-down list.
  3. Enter your hosting username and password, then click Log In.
  4. Click Websites & Domains from the left-side menu.
  5. Under the primary domain name, click on the File Manager icon.
  6. Click on the httpdocs folder from the left-side panel under Home directory.
  7. Look for the web.config file and click on it to open.
    You can also click on the menu icon to the right of the file and select Edit in Code Editor from the drop-down list.
  8. Add the following script to redirect an entire directory to a new location, replacing http://domain.com with the URL of the target website:

    Note: Remember to save a backup copy of the file before making any changes.

    For 301 redirect:
    <?xml version="1.0"?>
      <configuration>
        <system.webServer>
          <httpRedirect enabled="true" destination="http://domain.com/newdir" httpResponseStatus="Permanent" />
        </system.webServer>
      </configuration>
    
    For 302 redirect:
    <?xml version="1.0"?>
      <configuration>
        <system.webServer>
          <httpRedirect enabled="true" destination="http://domain.com/newdir" httpResponseStatus="Temporary" />
        </system.webServer>
      </configuration>
    
  9. Click OK to save.

Congratulations! You have just done a 301/302 redirection for your primary domain on Plesk.

Was this helpful? Yes No 91% of people found this helpful.
we're
online
Need Help? Chat Now