I'm migrating a site that uses subdomains. I want to test the subdomain's work on my machine before fully migrating the site. So I've chosen a fake domain name for my site, given it a subdomain name, and set it up with an Apache server. The domains are:
main = www.mysite.com subdomain = app.mysite.com I have set my host configuration file on Windows to be the following:
# My DNS overrides <my-aws-ip> www.mysite.com <my-aws-ip> app.mysite.com Where <my-aws-ip> is the IP address of the EC2 instance I'm testing on. My configuration file for my Apache server is the following:
<VirtualHost *:80> ServerName www.mysite.com DocumentRoot /var/www/mysite <Directory /var/www/mysite> Allowoverride All Require all granted </Directory> ErrorLog /var/log/httpd/mysite-error.log CustomLog /var/log/httpd/mysite-access.log combined </VirtualHost> <VirtualHost *:80> ServerName app.mysite.com DocumentRoot var/www/mysite_app <Directory /var/www/mysite_app> Allowoverride All Require all granted </Directory> ErrorLog /var/log/httpd/app_mysite-error.log CustomLog /var/log/httpd/app_mysite-access.log combined </VirtualHost> However, when I visit my site I get redirected to an actual site called https://www.mysite.com. Why is this? Does WordPress automatically redirect, and how can I prevent this from happening?
homeand/orsiteurlare set tohttps://www.mysite.com.