Redirecting website visitors from one domain or page to another is a fundamental practice in web management. Among various redirection methods, 301 redirects stand out as a highly effective approach that benefits both users and search engines. A 301 redirect explicitly signals to search engines that a website or a specific page has permanently moved to a new Uniform Resource Locator (URL). For instance, if you are undergoing a re-branding effort, transitioning from an old business domain (e.g., oldbusiness.com) to a new one (e.g., newbusiness.com), implementing a 301 redirect ensures that all traffic and SEO value from the old domain are seamlessly transferred to the new one.
To ensure the proper functioning of most redirects discussed in this article (excluding manual redirects), it is crucial that your domain name is correctly configured to utilize a robust DNS hosting service. This typically involves setting up appropriate DNS records within your chosen DNS provider's control panel.
A 301 redirect can be established through various methods, such as modifying an .htaccess file, or implementing specific code in languages like PHP, JavaScript, or Perl. It's important to understand that while 301 redirects are commonly used for entire domain migrations, they are equally effective for redirecting individual pages. However, it's worth noting that some of the specific methods detailed below are designed primarily for whole domain redirection. Here is a comprehensive overview of the options available for setting up a domain forward or redirect:
- Plesk Domain Aliasing: This method is ideal for forwarding an entire domain to another domain and offers optional application to DNS, web, and mail services.
- Plesk Domain Forwarding: Enables forwarding a domain to any specified URL, with its application primarily confined to web services.
- Plesk Subdomain Forwarding: Allows for the redirection of a subdomain to any desired URL, exclusively applicable to web traffic.
- Custom Web Server Directives or Code: This flexible approach facilitates redirecting any URL to another using custom configurations within the web server or application-level code, applying solely to web services.
- Registrar Domain Forwarding: While capable of forwarding a domain to any URL, this method is generally not recommended unless you have full control over the registrar settings. Some registrars may not consistently use proper HTTP status codes, such as 301 (Moved Permanently) or 307 (Temporary Redirect), which can negatively impact SEO. This method exclusively applies to web traffic.
Redirect with a Domain Alias
When your objective is to forward an entire domain to another, for example, transitioning from mydomain.com to mynewdomain.com, the most straightforward method within Plesk is to implement a domain alias. Plesk intelligently handles the configuration, automatically establishing a 301 redirect to ensure a permanent and SEO-friendly transfer of authority.
- Access your Plesk control panel and navigate to the Add Domain Alias button.
- Provide the domain name you intend to forward, and then specify the target domain to which it should redirect.
- Retain the default settings for all checkboxes. Should you prefer not to forward mail services, simply uncheck the "Mail Service" option.
- Click the OK button to apply and save your configured settings.
Your domain-to-domain redirect is now successfully established.
Advanced Usage Note:
For advanced scenarios where you wish to alias DNS and mail services but specifically forward the domain to a particular page, you can achieve this by disabling the "Redirect with the HTTP 301 code" function within Plesk. Subsequently, you will need to incorporate the following directives into your website's .htaccess file:
RewriteCond %{HTTP_HOST} ^(www.)?youraliasdomain.tld [NC]
RewriteRule ^(.*)$ https://yourmaindomain.tld/location [L,R=301]
This configuration instructs the web server to specifically redirect visitors from youraliasdomain.tld to the designated new location, rather than simply aliasing the entire site. This approach is particularly effective for scenarios where a custom domain serves as a dedicated landing page on your primary website.
Redirect with Domain Forwarding
- If the domain has not yet been added to Plesk, log in and select the Add Domain button. Choose "Blank Website" and enter your domain name. If presented with the "Hosting Type" option, select Forwarding. If this option is not immediately visible, proceed with adding the domain and continue to the next step.
- If the domain already exists within Plesk, or if the "Hosting Type" option was not available in step 1, locate your domain in the Plesk list. Click on Hosting and DNS, then select Hosting. Beneath the domain name, you will find "Hosting Type" with a dropdown menu to modify it. Click this dropdown and select Forwarding.
- Specify the destination URL where the domain should redirect.
- Carefully select the forwarding type or HTTP response code. If there is a possibility that this forward might be removed in the future, choosing "Moved Temporarily" is advisable. Otherwise, for a permanent redirection, select "Moved Permanently." Note that frame forwarding is generally not recommended due to potential SEO and usability issues.
- Click OK to save your configurations.
Your domain-to-URL redirect is now successfully active.
Redirect with Subdomain Forwarding
Should you need to forward a specific subdomain to an alternative URL, the following steps detail the process in Plesk versions 11.5 and later:
- Log in to your Plesk control panel and select the Add Subdomain button.
- Input your desired subdomain name and maintain the default settings as they appear.
- Click OK to initiate the creation of the subdomain.
- Within the settings for the newly created subdomain, locate and select Hosting Settings.
- Find the "Hosting type" option and click the Change link positioned next to "Website."
- From the dropdown menu adjacent to "Hosting Type," choose Forwarding.
- Enter the complete destination address for the redirect and click OK to save these settings.
Your subdomain-to-URL redirect is now successfully configured.
Redirect with Web Server Configuration
Nginx Redirects
For Plesk administrators, configuring an Nginx redirect can be accomplished using the following method:
- Access your Plesk control panel and navigate to the "Apache & Nginx Settings" section for the domain where you intend to implement the redirect.
- Scroll down to locate the "Additional Nginx directives" input box. (Note: This option is typically only visible to users with administrative privileges).
- Insert your preferred Nginx redirect configuration from the variants provided below into the box, then click "Apply" or "OK" to save the changes.
# Simple path to path redirect:
rewrite ^/source_path$ https://www.destination.com/new_path permanent;
# Regex redirect to redirect *all* content from one domain to another:
rewrite ^/(.*)$ https://www.destination.com/$1 permanent;
Apache and .htaccess Redirects
The accompanying visual guide demonstrates the process of utilizing an .htaccess file within a Plesk environment to manage redirects.
Manual redirects implemented via your .htaccess file are suitable for specific URL-to-URL redirections, for example, from mydomain.com/subfolder to mydomain.com/newfolder. While many content management systems, such as WordPress, offer plugins to simplify redirect management, utilizing the .htaccess file directly typically results in marginally faster execution times compared to plugin-based solutions.
You are welcome to employ the following directives when configuring your own .htaccess 301 redirects. Remember to substitute 'yournewsite.com' with your actual target domain name.
# Redirect everything:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^.well-known/acme-challenge
RewriteRule ^(.*) https://yournewsite.com$1 [R=301,L]
# Redirect specific pages (use this OR the everything rule above. NOT BOTH):
redirect 301 / http://yournewsite.com/
redirect 301 /oldpage/ http://yournewsite.com/newpage/
redirect 301 /oldpage.html http://yournewsite.com/newpage/
Code-Based Redirects
Another viable method for implementing redirects is directly within your web application's codebase. This can involve using a specialized plugin for platforms like WordPress or writing custom code in languages such as PHP. This approach is particularly recommended for lightweight websites or when managing redirects for specific subpages. To identify the most effective technique for your specific web application or programming language, a quick search query like 'WordPress redirects' or 'PHP redirects' will yield numerous valuable resources and solutions.
Performance Consideration: It is important to note that code-based redirects generally exhibit slower performance compared to web server-level redirects, which encompass all the solutions previously discussed. Consequently, for websites anticipating substantial traffic volumes through redirects, opting for a web server-based solution is highly advisable. Within a Plesk environment, the native Plesk options and custom Nginx redirects are typically the most performant, as they leverage Nginx for efficient processing.
Should Multiple Domains Be Aliased for SEO Benefits?
It's a common misconception that simply aliasing multiple domains to a single main site provides SEO advantages. However, if an address does not host unique content directly, it will not accrue independent SEO benefit. Consider this example:
MAINDOMAIN.TLD– This represents your primary website.HEY-LOOK-I-GOT-A-KEYWORD.TLD– This might be considered a 'keyword domain.'
If HEY-LOOK-I-GOT-A-KEYWORD.TLD merely forwards via a 301 redirect to your main domain, search engines like Google largely disregard its standalone existence, focusing solely on the destination URL.
Conversely, if HEY-LOOK-I-GOT-A-KEYWORD.TLD hosts an optimized and content-rich landing page that includes relevant links pointing to MAINDOMAIN.TLD, it can indeed derive SEO benefits from its targeted keywords. Moreover, it can strategically pass some of that valuable SEO authority to the designated destination page.
Consequently, the predominant rationale for acquiring multiple domains that point to the same site is primarily for defensive purposes, specifically to prevent typosquatting. For example, if you operate under DOMAINA.TLD, it could be strategically important to also secure variations such as:
DOMAINA.TLDOMAIN-A.TLDDOMAINAS.TLD
This practice is not undertaken for direct SEO gains but rather to safeguard your brand and business from others potentially diverting traffic or establishing a presence on very similar domain names. It ensures that your online identity remains protected and coherent.
