Redirecting website visitors from one domain or page to another is a common requirement in web management. Among the various methods available, 301 redirects are widely recognized as a highly effective and search engine-friendly approach. A 301 redirect serves as a definitive signal to search engines that a website or a specific page has permanently relocated to a new URL. For instance, if a business undergoes a re-branding from "oldbusiness.com" to "newbusiness.com", implementing a 301 redirect from the old domain to the new one is crucial for maintaining search engine rankings and ensuring a smooth user experience.
For most of the redirect types discussed in this guide (excluding manual redirects), it is essential that your domain name is properly configured to use your DNS hosting. This configuration typically comes with most hosting plans. If your domain is not configured this way, you would additionally need to manually create a DNS record within the control panel provided by your DNS hosting company to ensure the redirects function correctly.
There are several distinct methods to set up a 301 redirect, ranging from server configuration files like .htaccess to various programming language solutions such as PHP, JavaScript, or Perl. It's important to understand that while 301 redirects can facilitate the movement of an entire website, they are also versatile enough to redirect individual pages. However, some of the specific methods outlined below are primarily designed for domain-wide redirections. Here are the principal options available for establishing a domain forward or redirect:
- Plesk Domain Aliasing: This method is ideal for forwarding an entire domain to another domain and can optionally extend to DNS, web, and mail services.
- Plesk Domain Forwarding: This option allows you to forward a domain to any specified URL, primarily applying to web traffic.
- Plesk Subdomain Forwarding: Similar to domain forwarding, this specifically handles the redirection of a subdomain to any URL, exclusively for web content.
- Custom Web Server Directives or Code: This advanced method enables the redirection of any URL to another via custom configurations or scripting, affecting only web operations.
- Registrar Domain Forwarding: While capable of forwarding a domain to any URL, this method is generally not recommended unless you can verify that your registrar uses appropriate HTTP status codes, such as 301 or 307. Inconsistent use of these codes can negatively impact SEO. This method exclusively applies to web forwarding.
Redirecting with a Domain Alias in Plesk
When the objective is to forward an entire domain to another (e.g., from "olddomain.com" to "newdomain.com"), Plesk offers a straightforward solution through its domain aliasing feature. By simply adding a domain as an alias, Plesk intelligently configures a 301 redirect automatically, ensuring that all traffic and search engine signals are correctly passed to the new destination.
- Access your Plesk control panel and locate the Add Domain Alias button.
- Input the domain name you intend to forward, and then specify the target domain to which it should be redirected.
- It is generally advisable to retain the default settings for all checkboxes. However, if mail services are not to be forwarded, ensure that the “Mail Service” option is unchecked.
- Confirm your settings by clicking the OK button.
Once these steps are completed, your domain-to-domain redirect will be successfully established.
Advanced Domain Alias Configuration
For more specific scenarios, where you might want to alias DNS and Mail services but direct the domain to a particular page rather than the entire main site, an advanced configuration is possible. This involves disabling the automatic “Redirect with the HTTP 301 code” function within Plesk and subsequently adding custom rules to your website’s .htaccess file. This approach is particularly useful for directing traffic from a custom domain directly to a specific landing page on your primary site, enhancing flexibility and control over your domain strategy.
RewriteCond %{HTTP_HOST} ^(www.)?youraliasdomain.tld [NC]
RewriteRule ^(.*)$ https://yourmaindomain.tld/location [L,R=301]
This snippet instructs the web server to identify requests made to "youraliasdomain.tld" and then redirect them with a 301 status code to a precisely defined new location on "yourmaindomain.tld", rather than performing a site-wide alias. This level of control is invaluable for targeted campaigns or specialized landing pages.
Implementing Domain Forwarding in Plesk
Domain forwarding provides a flexible way to redirect a domain to any specific URL, offering more granular control than simple aliasing for certain scenarios. This method is particularly useful when you need to direct an entire domain to a subpage or a different web property altogether.
- If the domain has not yet been added to your Plesk environment, log in and select the Add Domain button. Opt for "Blank Website" and enter the domain name. If presented with the "Hosting Type" option, choose Forwarding. Should this option not immediately appear, proceed with adding the domain and continue to the next step.
- For domains already present in Plesk, or if the "Hosting Type" selection was unavailable during domain creation (as described in step 1), locate your domain within the Plesk list. Navigate to "Hosting and DNS" and then click on "Hosting". Below the domain name, you will find "Hosting Type" accompanied by a dropdown menu. Click this dropdown and select Forwarding.
- Input the complete destination URL where the domain should forward.
- Carefully select the forwarding type or response code. For redirects that might be temporary or subject to future changes, "Moved Temporarily" (302 redirect) is advisable. However, if the move is permanent and you wish to transfer SEO value, "Moved Permanently" (301 redirect) is the preferred choice. Frame forwarding is generally discouraged due to potential issues with SEO and user experience.
- Finalize your configuration by clicking the OK button to save the settings.
Upon completion, your domain-to-URL redirect will be actively routing traffic to the specified destination.
Configuring Subdomain Forwarding in Plesk
Similar to domain forwarding, Plesk also facilitates the redirection of subdomains to any desired URL. This functionality is particularly useful for specific sections of a website, campaign landing pages, or when consolidating content under a main domain. These instructions apply to Plesk versions 11.5 and newer.
- Log into your Plesk control panel and select the Add Subdomain button.
- Provide the name for your subdomain and keep the default configuration settings.
- Click OK to initiate the creation of the subdomain.
- Once the subdomain is created, navigate to its individual settings and select Hosting Settings.
- Within the "Hosting Settings" section, locate "Hosting type" and click the Change link adjacent to "Website".
- From the dropdown menu under "Hosting Type", select Forwarding.
- Enter the complete destination URL for the subdomain and click OK to apply and save your changes.
With these steps, your subdomain will now successfully forward to the specified URL.
Web Server Configuration for Redirects
For advanced users or specific redirection requirements, configuring redirects directly at the web server level (Nginx or Apache) offers superior performance and flexibility. These methods bypass application-level processing, resulting in faster redirect execution.
Nginx Redirects
If you have administrative access to Plesk, you can implement Nginx redirects directly. This method is highly efficient for handling redirects at the server level.
- Log into Plesk and navigate to the “Apache & Nginx Settings” under the domain where you intend to apply the redirect.
- Scroll down to locate the “Additional Nginx directives” box. Please note that this option is only visible to users with administrative privileges.
- Insert the appropriate Nginx rewrite rules into the box. Choose from the following common patterns, then click "Apply" or "OK" to save.
# 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;
These directives instruct Nginx to perform a permanent 301 redirect based on the specified source and destination paths, offering powerful control over URL rewriting.
Apache and .htaccess Redirects
For web servers utilizing Apache, redirects can be configured via the .htaccess file. This is particularly useful for redirecting specific URLs, such as "mydomain.com/subfolder" to "mydomain.com/newfolder". While many content management systems, like WordPress, offer effective plugins to simplify redirect management, implementing redirects directly within the .htaccess file generally provides a performance advantage, executing fractions of a second faster.
The following examples illustrate how to set up 301 redirects within your .htaccess file. Remember to replace ‘yournewsite.com’ with your actual target domain.
# Redirect everything from the root domain:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^.well-known/acme-challenge
RewriteRule ^(.*)$ https://yournewsite.com$1 [R=301,L]
# Redirect specific pages (use this OR the "Redirect 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/
These rules offer flexibility for either redirecting an entire domain or precisely moving individual pages, ensuring that visitors and search engines are directed to the correct new locations.
Implementing Code-Based Redirects
Beyond server-level configurations, redirects can also be managed directly within your web application's code. This approach often involves using specialized plugins for platforms like WordPress or crafting custom redirection logic using programming languages such as PHP. Code-based redirects are particularly suitable for lightweight websites or when dealing with highly specific subpage redirections that require application-level logic. To discover the most appropriate method for your specific web application or programming language, a quick search for terms like ‘WordPress redirects’ or ‘PHP redirects’ will yield numerous valuable resources.
Performance Considerations for Code-Based Redirects
It is crucial to be aware of the performance implications associated with code-based redirects. These methods typically incur a greater processing overhead compared to the web server-level redirects discussed earlier. Consequently, if your website anticipates a substantial volume of traffic hitting these redirects, opting for a web server-based solution is highly recommended. For environments supported by Plesk, the integrated Plesk-powered options or custom Nginx redirects offer the highest performance, as they are implemented efficiently at the Nginx server level.
SEO Implications of Domain Aliasing and Multiple Domains
A common question arises regarding the SEO benefits of aliasing multiple domains to a single website. It's important to clarify that if no unique content is hosted directly at an aliased domain, that address will not independently accrue SEO value. For example, if "keyworddomain.tld" simply forwards via a 301 redirect to "maindomain.tld", search engines like Google will primarily recognize and index "maindomain.tld", effectively disregarding the aliased domain's direct contribution to search rankings.
However, a different scenario applies if "keyworddomain.tld" hosts an optimized, informational landing page with unique content, and this page includes contextual links pointing to "maindomain.tld". In this case, "keyworddomain.tld" can indeed gain SEO benefit from its targeted keywords and strategically pass some of that authority and relevance to the destination page on "maindomain.tld". This strategy allows for a more nuanced approach to leveraging multiple domains for SEO.
Consequently, a principal reason for acquiring multiple domain variations for a single website is often not for direct SEO gains through simple forwarding, but rather for defensive purposes, specifically to prevent typosquatting. Typosquatting involves registering domain names that are slight variations or common misspellings of an established brand's domain, potentially diverting traffic or causing confusion. For instance, if you own "yourdomain.tld", it might be prudent to also secure similar domains such as "yourdomain.com", "your-domain.tld", or "yourdomain.net". This practice primarily serves to safeguard your brand and prevent others from capitalizing on closely related domain names, rather than to enhance SEO directly. Further insights into the value of owning various domain types can be found in specialized articles on keyword domains.
