DNS issues resolved

After writing my prior post, I of course kept digging, and surprisingly quickly managed to find a solution.  Turns out my issue was not with DNS, but rather with needing a Rewrite directive in my Apache configuration.

Specifically, my solution requires a DNS A record, which adds “nextcloud” as a valid subdomain.  Once that was configured, nextcloud.halfling13.com would resolve to the primary wordpress website.  http://halfling13.com continued to work, and https://halfling13.com continued to go to the nextcloud site.

At that point, I added some basic code to the apache configuration file, and with a bit of trial and error and luck, rewrote the conditions so that any non-https connection to halfling13.com, with the nextcloud subdomain, would automatically re-write to the correct https://halfling13.com address.  The specifics are as listed:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(nextcloud)\. [NC]
RewriteRule ^/?(.*) https://halfling13.com [R,L]

A quick restart of Apache, and all traffic was up and running, and connecting to the proper locations.  From there, I just needed a new logo on the WordPress site, and Nextcloud is fully operational and secure – and all from a self-hosting single domain and IP. Much happiness.

Leave a Reply

Your email address will not be published. Required fields are marked *