Reputation: 45
I recently migrated from HostGator to AWS. Everything has worked, including the SSL. This happens on all browsers. Here is what I have setup: (Screenshots attached)
An EC2 instance that's running the WordPress AMI and has an Elastic IP assigned EC2
ACM for both domain.com and www.domain.com, verified by DNS on Route 53 ACM
Target Group with port 80 and HTTP protocol being targeted to the EC2
instance Target Group
Load Balancer listening to port 80 and 443 both forwarded to Target Group Load Balancer
Route 53 with the A record using the Load Balancer as an alias Route 53
CloudFront with domain.com as origin domain name(www.domain.com as CNAME), protocol of "Match Viewer", and connected to the ACM certificate CloudFront.
What would be causing the error? Where should I start looking?
Upvotes: 3
Views: 2933
Reputation: 125
I had to add these into wp-config.php
to stop too many redirects
with configuration: ALB -> EKS -> WordPress Pod
define('WP_CONTENT_URL','https://example.com/wp-content/');
$_SERVER['HTTPS'] = 'on';
$_SERVER['REQUEST_SCHEME'] = 'https';
# For some reason updating plugins doesn't work properly without this.
define('FS_METHOD', 'direct');
# In this case, these weren't required, but I left them here to remind if they would be required in some case.
#define('WP_HOME','https://example.com/');
#define('WP_SITEURL','https://example.com/');
Upvotes: 0
Reputation: 7170
I had a similar problem, and in my case I was able to solve the problem adding this line to .htaccess
:
SetEnvIfNoCase X-FORWARDED-PROTO "^https$" HTTPS
Upvotes: 2
Reputation: 842
simply add these two lines of code there
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
3. or check deactivating all plugin, anyof plugin maycauing the issue
Upvotes: 3