aws centos 7 wordpress apache redirect - wordpress

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.

Related

How do I point my domain to my website that's hosted on an AWS EC2?

The registrar for my domain is godaddy, I go to their DNS records section and I changed the A name to the elastic IP associated with my instance. Now when I type my domain in the browser, my website appears! However, it forwards it to the IP of my server.
Things I've tried (whether logical or not):
I'm using wordpress multsite so I changed the DOMAIN_CURRENT_SITE in wp-config.php to my new domain. No luck. Reverted.
I changed the 'site_url' and 'home' in my database to point to my domain. No luck. Tried one at a time etc. Reverted.
Changed ServerName to my new domain in httpd.conf (apache).
sudo hostname www.... (don't know what that does)
So I'd like to simply have my website open without it showing the IP in the address bar. Can someone help?
Thanks
EDIT:
Here's the DNS page of godaddy, I've blanked out the ip in the A records, but it's just the ip of my server.
First you need to set Custom NS in godaddy with AWS dedicated IPs then set them as DNS. If you are using Linux instance with cPanel then just add the domain in cpanel's addon-domain.
If you are using Windows instance then you should configure IIS.

IIS 10 Site Bindings wildcard development machine

I have successfully setup IIS on my local development machine (dev branch - setup as localdev.me) but when I went to setup another branch (hotfix - setup as localhotfix.me) I am running into issues. The issues are due to the way the site is setup. The subdomain of the url is used to determine which Database to connect to. So going to host.localdev.me will connect to the host database. So in IIS I have the following settings for the bindings of the site.
Type Host Name Port IP Address
http localdev.me 80 *
http *.localdev.me 80 *
I can ping localdev.me with any subdomain and I get the loopback address as expected. When I then setup the hotfix branch (exactly the same as the dev but with the following bindings) I get name not resolved errors.
Type Host Name Port IP Address
http localhotfix.me 80 *
http *.localhotfix.me 80 *
Is there a reason the first setup would work and not the second? What is perhaps even stranger if I tell IIS to stop I can still ping subdomains on localdev.me and get the loopback address.
I could always get it working by manually specifying the host name in my windows hosts file but I would rather not do that as I would need to go in and edit the file every time we add a new subdomain.
EDIT: These are the specific errors I am getting.
ping localhotfix.me
Ping request could not find host localhotfix.me. Please check the name and try again.
EDIT2: I have a solution that works fairly well. It requires Acrylic DNS and installation of the Microsoft Loopback Adapter. I set the loopback adapter to a valid IP Address and set the DNS server to 127.0.0.1 then edit the AcrylicHosts file to contain entries for each domain with a wildcard. Once I did all of this I was able to ping localhotfix.me along with *.localhotfix.me. I believe the reason localdev.me worked is because it is a valid domain. The name would resolve at which point I believe IIS was able to take over. But thats really just an educated guess. But kindof makes sense as to why it worked for one and not the other.
The reason *.localdev.me works without a hosts file is because the public DNS for that domain resolves to 127.0.0.1 as long as it is not localdev.me or www.localdev.me. You can check this using nslookup *.localdev.me (replace the asterisk with anything except www) while your hosts file is empty. On the other hand, *.localhotfix.me is not registered in public DNS at all, which is why you'd need a hosts file entry for those.

mamp pro virtual host will only work on port 8888

I have a series of vhosts that work fine on global settings of port 80 set in mamp pro. One new vhost I created will not work though on this port. I type in my vhost in thew browser or even use the link provded and it appends a :8888 onto the link and says can't establish connection to server.
When I change that vhost port # to 8888 then it works.
The problem is the :8888 remains and is screwing up my url routing for navigating the site especially with a standard wordpress build, I cant get into my admin section bc wordpress donest understand the :8888.
Any ideas how to fix this issue with mamp pro?
First you need to change port to 80
Server->general Apache value to 80 then create vhost
in Host ->add new
Server name
ip/port you can add as *
then disk location
that it done !

Redirect to other address Wordpress MAMP

I move my wordpress from my server to my localhost in the database I change
http://www.hybrid-tech.net/praxi3 to http:// localhost:8888/praxi3
after that, when I try to see the website on my localhost I go to
http:// localhost:8888/praxi3
but it's redirect me to
http:// localhost/praxi3
and I'm don't understand why. I back up a restore many times this database and I still getting this problem.
Thanks in advance for your help.
PD: I'm using mamp. The localhost link are without the space I mean http://lo....
You should check your mamp configs :
Is your apache port set to 80 ? If so the server redirects you to the 80 (default web port)
Try setting it to the 8888 port and refresh your page using the flush cache command :
ctrl+r or apple+r

How to not use apache port from site URL with acquia drupal

Acquia drupal always puts the apache port :8082 to the end of site url, e.g.: http://localhost:8082.
I have a custom site url:
http://somesite:8082
I want to access it just by http://somesite
How to make it work without :8082?
Any hint would be very much appreciated.
Thanks
Sorry, you're kind of out of luck. The only way to get that port to go away is to server on either port 80 (http) or 443 (https). Web browsers treat those as the default ports, hence, you don't have to specify. You need the port there so that the browser knows where to go to find Drupal. If you can't run the Acquia Drupal Apache server on port 80, you could optionally run a proxy on port 80 that redirects to the correct place. However that's probably more trouble than it's worth.
Basically, don't worry about it, whenever you move your site off of your localhost onto a live server, you'll be able to run in on port 80 and that pesky port number won't be there anymore.

Resources