AWS WordPress ERR_TOO_MANY_REDIRECTS - wordpress

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?

Check URL settings via Administrator Dashboard
or change the URL from wp-config.php
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
or try using Simple SSL plugin.

Related

aws centos 7 wordpress apache redirect

I've got EC2 Amazon Linux 2 instance with apache, mariadb and wordpress
VPC, Security group, ACL are set up correctly, i'm using same rules for other websites and works perfectly
telnet ip 443 and telnet ip 80 - both are reachable, checked and connected
I don't have access to DNSes, so I changed windows host file. Both are pointing to the same ip.
x.x.x.x example.com
x.x.x.x example.sandbox.com
ping recognize both and showing that there is no issue with host file.
First website with SSL.
Second website without SSL (tests purposes).
They are using same database but different schema. So table
wp_options and value for home and siteurl are set up correctly for
https://example.com for first one and http://example.sandbox.com for
test one.
First website is working fine, showing example.com with SSL. Nothing to do. Problem is with test environment. Everytime I try to reach example.sandbox.com chrome first shows me warning that page is not secured (expected) and after that redirects me to example.com. Same with Firefox. After added exception it redirects me to example.com. I run out of ideas...
Apache configs in comment. Have no idea how to paste it into post without error. Spent hour on it...
Found it!
Wordpress plugin really-simple-ssl. Removed it and it works.

GoDaddy domain in AWS with SSL for Wordpress application Issue

Currently, I am working on a Wordpress application and I am using AWS hosting. My domain is in GoDaddy.com and I have deployed the application in elastic beanstalk. I have created load balancer and also I need to run the application through HTTPS.
I have done my research and I think I found the right way, but it's not working for HTTPS. when I browse on HTTP on port 80, it runs well. Now I am helpless.
Here's what I have done so far:
1) I created a hosted zone on AWS Route 53 for the domain named "example.com". There are two records are created, NS and SOA.
2) Then, in GoDaddy, I added NS records from AWS as Custom Nameservers.
3) After that, I created A record for the domain in the AWS hosted zone, set ALIAS targeted to the Load Balancer of the Elastic Beanstalk environment.
4) Then, I changed the SITE URL from the wp_options table the wordpress application database.
After doing up to this, my application was running in HTTP. But as I want to change it to HTTPS. So,
1) I requested a certificate from AWS Certificate Manager and created CNAME (provided by ACM after requesting certificate) record in the hosted zone.
2) After the certificate is issued, I edited the listener from EC2 >> Load Balancer >> Listener and changed the protocol from HTTP to HTTPS and also allowed port on Security groups.
3) Also, I changed, the SITE URL from WordPress database and changed it from "http://example.com" to "https://example.com" but it was not working.
4) So I went to Elastic Beanstalk >> Configuration >> Load Balancer and added listener. After the environment is saved and restarted, still, the site was not running on HTTPS [ HTTP 408 ERROR IS SHOWN ]. But if I change SITE URL to "http://example.com", it works
I have found a solution, which says to use RedirectURL and set it to server config but I don't want to do that.
I also found this solution which suggest to Export Zone File and import it to AWS hosted zone. But whenever I click Export Zone File(Unix), the file downloaded is shown empty. I tried this for other accounts, still, this problem exists. So I did not do that.
Sorry for the long story, but I really need this help.
I have solved the issue.
In my load balancer port configuration, I previously set load Balancer port 443 and instance 443. here what I need to do is to call the load balancer on port 443 and backend make the backend call on port 80 and enable https on WordPress.
So I kept load balancer port 443 and changed the instance port to 80. After that, on the browser, there was too many redirects error shown. So then what I needed to do is that add $_SERVER['HTTPS'] = 'on' on wp-config. And then everything was running smoothly.
I hope this will help if some

Can I hide the port number in wordpress

I am setting up a corporate intranet site using WAMP and wordpress. I have a server running IIS on port 80 and WAMP on port 8080. I have the wordpress site running under WAMP. I want to publish the wordpress site without the port number.
For example, http://MyServer/MySite rather than http://MyServer:8080/MySite.
I have tried leaving the port number out of the "Site Address (URL)" but that doesn't work.
You need to reverse proxy it in iis
you need to install URL rewrite and Application Request Rerouting ( both MS plugins )
Then make a virtual directory under your main site (at the location you want "MySite" ), and go to url rewrite and it has an option to create the reverse proxy.
This will also mean you get HTTPS if your main site has HTTPS already
and reverse proxy to where your WAMP is hosted on your server

AWS Route53 routing wordpress subdirectories to different EC2 instances

I have domain setup like http://www.example.com/in which is a wordpress multisite setup and hosted on a AWS EC2 instance.
I have to make another similar setup with url http://www.example.com/uk but on another EC2 instance.
The domain www.example.com is routed to only one IP of first instance.
Can anyone advise on how I should setup this routing to make this scenario on Amazon Route 53?
Assuming you are serving your site using apache you can add a .htaccess rule on the instance hosting www.example.com to redirect www.example.com/uk traffic to another ip address.
This will mean you rely on www.example.com to redirect traffic for www.example.com/uk. In the event the instance running www.example.com were to become unavailable, www.example.com/uk would become inaccessible.
Alternatively, you can setup a subdomain in Route53 with the following entry
uk.example.com 1.2.3.4
This will mean that www.example.com/uk will need to be accessed using uk.example.com not www.example.com/uk

Deploying my website to the pulic using IIS and windows server

I recently bought a domain. Let's say my domain is "domain.com", and I made a website in visual web dev. using ASP.NET and VB.NET. I also have an old computer that I turned into a home server so I installed windows server 2008 R2 SP2. So I uploaded my website to a folder and went to the IIS manager. There I added a website, set the sitename to "domain.com" application pool to "ASP.NET v4.0". Then the physical path to: "c:\websites\wwwroot\domain.com" then in the bindings I added 3 different things.
type hostname port IP adress
http www.domain.com 80 my IP found at www.what'smyip.com
http domain.com 80 my IP found at www.what'smyip.com
http *blank* 80 192.168.1.6(my server's internal IP)
I made sure port 80 is open in my router and I added a firewall inbound rule for port 80.
When I connect using 192.168.1.6 I get my website and everthing works like it should.
However when I connect using domain.com or www.domain.com I see a 404 page. http://prntscr.com/42ynf4
Also when I change my bindings and I change the IP for domain.com and www.domain.com like displayed below:
type hostname port IP adress
http www.domain.com 80 192.168.1.6(my server's internal IP)
http domain.com 80 192.168.1.6(my server's internal IP)
http *blank* 80 192.168.1.6(my server's internal IP)
It works just like it's supposed to?
I have done a DNSlookup on the domain and it's active. I'm a little bit stuck on this and I know you guys aren't experts on hosting but you all probably have more knowledge about this then I do.
You should check what is the server IP address (netstat), because you could use a proxy and then the Internet IP info will be not correct.
Also, make sure that you set the correct home page in IIS.

Resources