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

질문됨 5년 전198회 조회
3개 답변
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
답변함 5년 전
0

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

답변함 5년 전
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?

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠