Subdomain point to a different server

December 4, 2016 540 views
Apache Ubuntu 16.04

Hello,

I've just setup my main WP site and I am trying to setup a subdomain that points to a completely different droplet with its own IP address.

I have the DNS configured already to point to the new IP and its working. My problem is my virtual host default config file is messing me up and I'm not sure how to edit it.

Right now it routes all traffic to the main url to ensure it is https:

This is what I have now.
My subdomain I want is staging.every-tuesday.com

what am I missing?

<VirtualHost *:80>
ServerName www.every-tuesday.com
Redirect / https://www.every-tuesday.com/
</VirtualHost>

<VirtualHost *:443>
ServerName every-tuesday.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

    <Directory /var/www/html/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLEngine on
    SSLCertificateFile 
    SSLCertificateKeyFile 
    SSLCACertificateFile 

</VirtualHost>

Thank you in advance!

1 Answer

Never mind - its working as intended now :)

I was able to get it to redirect to my 2nd droplet - my first snapshot I was using I could not figure out why it kept redirecting to the old server. I followed all the steps to get the wordpress to not redirect:( anyways I just used an older snapshot and now I have it all working!

Have another answer? Share your knowledge.