doitlikejustin
doitlikejustin

Reputation: 6353

WordPress sites keep redirecting to no-www

I recently launched 3 new WordPress sites and for some reason they are all getting redirect loops. Going to www.example.com redirects to example.com. On one of them I have just decide to stick with the non-www since it was a brand new site, however the others I need to force the www.

So far I have tried the following:

I've never experienced this issue before until recently.

Upvotes: 3

Views: 2579

Answers (1)

doitlikejustin
doitlikejustin

Reputation: 6353

The issue actually had nothing to do with WordPress. After recently upgrading to Plesk 11.5 there is an option in the domain's "Hosting Settings" that was wrong. The setting is called "Preferred domain".

Preferred domain:

Regardless of the domain's URL that visitors specify in a browser (with the www prefix or without it), a page with the preferred domain's URL opens. The HTTP 301 code is used for such a redirection. The 'None' value means that no redirection is performed.

For some reason it defaults to "domain.tld" but it should be set to "None". This fixes the problem instantly and now WordPress does not go into a redirect loop.

Here are the steps to change it:

  1. Go to your domain name
  2. Click on "Websites & Domains"
  3. Click on "Hosting Settings"on the domain name
  4. Find "Preferred domain" and select "None"

Upvotes: 4

Related Questions