Permanently 301 Redirect a Domain Name through HELM
If you are using Parallel’s ( was Webhost Automation’s ) HELM control panel, you might be scratching your head on how to get HELM to set up a 301 permanent redirect to a URL.
We scratched our heads on it for a while too, and frankly, we stumbled up one the answer quite by accident.
Two of the really nice advantages of being able to use HELM to configure your 301 redirects are:
- Hey, let HELM do the work for you instead of spending much more time manually configuring IIS and your DNS to do it!
- Perhaps even better, have all of these configurations stored within HELM so that your next migration or server upgrade is a snap.
There are two approaches that you could take — depending on whether you are also running Helicon Tech’s ISAPI_Rewrite.
If you are running ISAPI_Rewrite:
This is definitely the preferable way to go. It is more elegant and much easier.
Simply add Domain Aliases to the appropriate Hosting Plans in HELM. Then drill into a site you need to provide the redirect, and go to Domain Aliases and add a new Domain Alias. HELM will than add the appropriate host headers in IIS, create the DNS records (including MX & A record for email), and configure SmaterMail to alias the email as well. Wow! That was easy.
However, at this point, all you have is a 302 redirect, which is bad news for SEO. This is where ISAPI_Rewrite comes in. Use ISAPI_Rewrite to provide the 301 Permanent redirect. The following condition and rule will redirect any and all aliases to the true domain name:
RewriteEngine on
# Redirect Any and All domain aliases to true domain:
RewriteCond %{HTTP_HOST} !^www.MyDomain\.tld [NC]
RewriteRule ^(.*)$ http://www.MyDomain.tld/$1 [R=301,L]
You can either use your Helicon Manager, the ISAPI_Rewrite tab in IIS, or simply save it to a .htaccess or httpd.ini file (depending upon how you have ISAPI_Rewrite configured) in the site’s web root.
Simple as that! Just add the Domain Alias to HELM and the redirect rule via ISAPI_Rewrite.
BTW, this has the added benefit of assuring that the domain is not accessed without www. — another SEO benefit. However, we recommend that you handle this particular issue globally. See 301 Redirecting on a Windows Server.
If you are not running ISAPI_Rewrite:
If you are not running ISAPI_Rewrite, then you’ll have to use a different method in HELM to create the redirect as a 301 redirect in IIS . . . and if you will also be aliasing email, you’ll have to manually configure the DNS for email.
- While logged in as an admin to HELM, under the appropriate Reseller Plans, enable “Allow Web Forwarding” (Plan Resources > Web Resources)
- For each appropriate Reseller, enable “Allow Web Forwarding” (Plan Resources > Web Resources) for the appropriate Hosting Plans
Now these Hosting Plans can have access to this resource. To keep things tight, we added a new hosting plan called “301 Redirect” with no resources other than “Allow Web Forwarding” and X domains (so that this plan includes a reasonable number of 301 redirectable domains, while not using any other resources).
Next, we need to add a domain to HELM. We would need to drill into a Package that has this resource enabled, and then go add a domain to that package.
Once the domain has been added, go to Web Site Settings for that domain and input the Web Forwarding URL . . . and here’s the “secret”: to make it a permanent 301 redirect to a URL, use the command “PERMANENT” (it must be in all caps). For example:
http://www.MyDomain.tld, PERMANENT
Voila – HELM has just added the IIS properties and DNS records for you, AND you now have a record of all of this in HELM ready for a any migration or server upgrade.
Now, let’s just suppose that you also need to handle domain aliases for email – probably you are using SmarterMail if you are using HELM. While HELM can’t enable aliased domains for email, the MX and A record for this must be set up in your DNS first anyways. Here’s how you can use HELM to facilitate that:
Enable DNS Resources and “DNS Zone Editor” in the Package Resources of applicable Packages.
To configure, you’ll need to add two zone records:
- An MX record – something like “mail.MyDomain.tld” (you’ll need to assign the name a wild card — * — in HELM, and it won’t take a null value.)
- An A record – “Name” something like mail.MyDomain.tld “Record Data” would be the IP address for your mail server.