Call us! (ID:64475)
+1-727-546-4678
HomeBlogHow to configure WPML for multiple domains on Hepsia shared hosting

How to configure WPML for multiple domains on Hepsia shared hosting

Our shared hosting platform is fully compatible with WPML, and it is very easy to set it up to make different languages show on different domains – even easier than explained in WPML’s own configuration guide.

Just follow these simple instructions:

  1. Go to Hosted Domains in our hosting control panel
    1. If you have not yet hosted the domain for your secondary language – click Host Domain up in the right corner.
    Host and edit domain for WPML
  2. In the Actions column, click Edit domain
  3. Beside the Path field, click Browse
    Change domain root for WPML
  4. Choose the folder where your DEFAULT WordPress installation is located and click Select.
  5. Click Edit Host.

You’re done! Yes, that is how incredibly simple it is to set up WPML domains on Hepsia!

But there is one thing that WPML does not tell tell you about, a detail that is extremely important for SEO!

Extremely important: Set your WPML www-redirections right for good SEO

Do not miss to notice this non-SEO friendly behavior of WPML:

If you have set your secondary language to show on http://www.yourseconddomain.com, note that a visit to http://yourseconddomain.com (without www) will redirect to your DEFAULT site.

Let’s say that again.

If your primary language is English, and you’re setting up a German site on http://www.mygermansite.de, and you attempt to visit the German site on http://mygermansite.de (without www) – you will be redirected to your English site!

This is of course very bad for SEO. If someone would link to your secondary domain and forget to put www in the link, it will be 301 redirected to the site in another language than expected.

So you need to create 301 redirects for proper SEO friendly behavior.

The below codes will work on our hosting platform (Hepsia control panel). Choose which one depending to if you use www or not for your target site.

Redirect from non-www to www keeping the language

Copy the below code and paste it into your .htaccess file (in your default WordPress directory).

  • Change [yourseconddomain] to your domain
  • Change TLD if not .com
# Non-WWW to WWW redirect by ServeU.net
RewriteCond %{HTTP_HOST} ^\yourseconddomain\.com [NC]
RewriteRule ^(.*)$ https://www.yourseconddomain.com/$1 [L,R=301]    ## NOTE: Change to https if you use SSL
# END Non-WWW to WWW redirect by ServeU.net

Redirect from non-www to www keeping the language

Copy the below code and paste it into your .htaccess file (in your default WordPress directory).

  • Change [yourseconddomain] to your domain
  • Change TLD if not .com
# WWW to non-WWW redirect by ServeU.net
RewriteCond %{HTTP_HOST} ^www\.yourseconddomain\.com [NC]
RewriteRule ^(.*)$ http://yourseconddomain.com/$1 [L,R=301]    ## NOTE: Change to https if you use SSL
# END WWW to non-WWW redirect by ServeU.net


Now it’s time to pat yourself on your shoulder and say: You did something very smart that many WPML users should have done but did not do because they did not read this blog.

So put on a smile and celebrate with a donut – you’re worth it!

Post a Comment

You must be logged in to post a comment.