## amazon – How to prevent redirection from non-www to www or vice versa?

Question

In WordPress, it seems that if I define:

define('WP_SITEURL', 'https://www.example.com');
define('WP_HOME', 'https://www.example.com');


Then all non-www version such as https://example.com will be redirected to www version and the response header will be:

X-Redirect-By: WordPress


This is OK for general cases. However, now I want to prevent such a redirection, because I am using Amazon Cloutfront and the redirection should be stopped, otherwise, there will be error. See https://stackoverflow.com/questions/20503322/cloudfront-distribution-with-custom-origin-redirects-request/22571467#22571467

So how to prevent the redirection?

0
1 week 2021-09-14T20:58:17-05:00 0 Answers 0 views 0