1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Redirects in Plesk

Redirects in Plesk

 

Use the instructions below to redirect a domain in Plesk for Windows Shared and Dedicated hosting.

WARNING! Before performing any of the following steps, it is recommended that you make a backup of your account. Unfortunately, when you select Forwarding in Plesk, all settings and content are deleted from the server. Without a backup, there will be no way to restore anything that has been deleted.

Please click the links below to jump to a section.

Note: This example is using Plesk 18. The steps will be the same for other versions of Plesk; however, the button locations may be different.

How To Add a New Domain Forwarder

To add a new domain forwarder:

  1. If you are subscribed to several hosting packages and have access to several web spaces associated with your account, select the required webspace in the Subscription menu at the top of the screen.
  2. Click the Websites & Domains tab.

    Plesk - Website and Domains

  3. Click Add New Domain.

    Plesk - Add Domain

  4. A new window will be displayed. Specify the following:
    • Registered domain name: Type the domain name that you have registered with your service provider or a domain registration company.
    • Hosting type: Select the Forwarding option.
    • Activate the DNS Service: Put a checkmark.
    • Activate the  Mail Service boxes: Put a checkmark.

      Plesk - New Domain Details

     

  5. Expand the Forwarding Settings. Specify the following:

    • Destination address: Type the URL to which you want to redirect visitors.
    • Forwarding type: Select the preferred type of forwarding.
      Standard forwarding - A user is redirected to the site, and the actual site's address is shown in the user's browser, so the user always knows that he or she is redirected to another address. 
      Frame forwarding - A user is redirected to the site without knowing that the site actually resides at another location; therefore, frame forwarding should be preferred.

      Plesk - Domain - Forwarding Settings

  6. Click Add Domain.

Congratulations! The new domain is now added under the Websites & Domains section.


How To Create a Domain Forwarder With Existing Domain

To reconfigure an existing domain and make it a domain forwarder:

  1. Go to the Websites & Domains tab.

    Plesk - Websites and Domains

  2. Locate the domain you wish to modify, then click Hosting Settings under the domain.

    Plesk - Hosting Settings

  3. On the Hosting Settings page, click the [Change] link next to the Hosting type field, then select Forwarding from the dropdown.
  4. You will be redirected to the Change Hosting Type section. Specify the following:

    • Destination address: Type the URL to which you want to redirect visitors.
    • Forwarding type: Select the preferred type of forwarding.
      Standard forwarding - A user is redirected to the site, and the actual site's address is shown in the user's browser, so the user always knows that he or she is redirected to another address. 
      Frame forwarding - A user is redirected to the site without knowing that the site actually resides at another location; therefore, frame forwarding should be preferred.

      Change Hosting Type

  5. Click OK.

How To Add a Subdomain Forwarder

To add a subdomain forwarder:

  1. Click Websites & Domain.

    Plesk - Websites and Domains

  2. Locate the subdomain you wish to become a forwarder, then click Hosting Settings.

    Subdomain - Hosting Settings

    If there is no subdomain yet, you will need to create a new one first.

    1. Under the Website & Domains tab, locate the main domain where you wish to add a subdomain, then click Add Subdomain.

      Plesk - Add a Subdomain

    2. On the Add a Subdomain page, enter the preferred subdomain name and document root.

      Add Subdomain Deails

    3. Click OK.
  3. In the Hosting Type section, click the [Change] link.

    Subdomain - Change Hosting Type

  4. You will be redirected to the Change Hosting Type section. Select Forwarding from the dropdown menu.

  5. Specify the following:

    • Destination address: Type the URL to which you want to redirect visitors.
    • Forwarding type: Select the preferred type of forwarding.
      Standard forwarding - A user is redirected to the site, and the actual site's address is shown in the user's browser, so the user always knows that he or she is redirected to another address. 
      Frame forwarding - A user is redirected to the site without knowing that the site actually resides at another location; therefore, frame forwarding should be preferred.
  6. Once done, click OK.

How To Create a 301 Redirect via web.config File

There are a few options for configuring a 301 redirect via a web.config file. The web.config file is typically located in the document root folder of your website. This file can be created if one does not already exist. A basic web.config file would contain the following configuration:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.web>  </system.web>  <system.webServer>

</system.webServer> </configuration> 
Note Improper formatting of the web.config file can result in a 500 Internal Server Error. A backup of the file should be created prior to editing.

The following entry can be appended to your web.config file to redirect an entire site or directory to a new location. For example, if you want http://example.com/olddir/ redirected to http://domain.com/ then open, or create, a web.config file in the ‘/olddir’ folder, and add the following line of code within the <system.webServer> section:

<httpRedirect enabled="true" destination="http://domain.com/" httpResponseStatus="Permanent" /> 

The following example is intended for redirecting a single page to a new location. For example, important pages of your site have .html extensions, and you want the new location to be its own directory, such as http://example.com/contact.html will change to http://example.com/contact/:

<configuration>

<location path="contact.html">

<system.webServer>

<httpRedirect enabled="true"

destination="http://example.com/contact"

httpResponseStatus="Permanent" />

</system.webServer>

</location>

<location path="about.html">

<system.webServer>

<httpRedirect enabled="true"

destination="http://example.com/about"

httpResponseStatus="Permanent" />

</system.webServer>

</location>

</configuration> 
If you need help with configuring a 301 redirect within your web.config file, please contact us via phone or Live Chat for assistance.