WWW and Non-WWW is clashing in Wordpress. Help!

0

Hello! I'm a volunteer that runs a Wordpress website at exeterstreethall.org. I know enough about websites to build it but sometimes not quite enough to fix it when things go wrong... so here I am.

In Wordpress I'm seeing errors that keep it in safe mode. Their support have told me that it's because I am running both www.exeterstreethall.org and exeterstreethall.org. Here's their response.

It looks like that your site can be accessed from both http://exeterstreethall.org/ and http://www.exeterstreethall.org/

This is an issue for search engines, since it often causes confusion and duplicate content, but it is also an issue for your site's communication with WordPress.com, as our system does not know whether it should connect to your site via one or the other address.

To solve this issue, I would recommend that you use one and only one address. For other addresses, you can redirect them to the main one.

It seems your site is using AWS, you can try having a look at this https://forums.aws.amazon.com/thread.jspa?threadID=251477

I have poked around as best I can in the Record Set page in AWS but haven't managed to find a fix. i'm not quite sure where to start in the information in the link above.

Can anyone talk me through this please?

Thanks,

David

demandé il y a 5 ans187 vues
3 réponses
0

I don't think that other thread they referred to is particularly relevant to your problem.

Both the root domain and the www subdomain are already resolving to the same IP address, so you don't need to make any changes in DNS. What you need is a 301 redirect from non-www to www (or vice versa, depending on your preference).

There are several ways to go about this. First, make sure your preferred domain is set in Settings > General in the Wordpress admin interface. Then insert these lines into the wp-config.php file:

define('WP_HOME',"http://www.exeterstreethall.org");
define('WP_SITEURL',"http://www.exeterstreethall.org");

Another is through the .htaccess file. Since Apache is your web server, there will be a file called .htaccess in the root folder of your website (where you can also find folders such as wp-includes and wp-content). It already includes a bunch of things for WordPress. Insert the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^exeterstreethall.org [NC]
RewriteRule ^(.*)$ http://www.exeterstreethall.org/$1 [L,R=301]

I don't see how not having the redirect would force Wordpress into safe mode, but it's certainly a good idea to have one canonical address instead of two "copies" of the same site on different (sub)domains.

Alternatively, there are plug-ins available that will help you set up redirects, but I'd use those as a last resort.

RobMM
répondu il y a 5 ans
0

Fantastic. That seems to have worked. I appreciate your help!

répondu il y a 5 ans
0

Hi, trying to solve the same issue. Use the same code in the .htaccess with no luck. Seems the system has updated the way it handles things.

Any updated solution?

répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions