I've taken the day to install the plugins I will need for my Multisite network. I've made quite a few backups and was about ready to actually add a second domain.
For all of my domains, I'm using SSL + Cloudflare.
SSL is working. Cloudflare is working.
The maindomain.com works perfectly.
I had added domain2.com in cpanel as an add-on domain to point to the same public_html as my maindomain.com
I have temporarily deactivated the WWW and A DNS settings in Cloudflare so it goes straight through to the server IP.
A few problems:
1) Main problem:
When I add a new site (maindomain.com/domain2.com) it gets created created. I can see it when I click 'all sites', but it does not show up in the My Sites menu bar on the top of Wordpress. On another installation (different account on the server), I do see a new site show up when I create it. I can go to list All sites in the left menu and click on Dashboard there to bring it up but not where I need it, in the menu at the top...
2) I have a rewriterule in .htaccess that makes sure that a full URL with and without WWW, and with and without SSL get rewritten to the correct https://maindomain.com/rest_of_the-URL_whatever
I've used this rule
RewriteRule ^/?(.*) https://maindomain.com/$1 [R=301,L]
This works great for when I have 1 domain but is causing havoc with multiple domains. I remember hardcoding the domain because it was faster to process. How can I change it that I have the same result for all additional domains without causing too much stress on the server or sending the server into a loop?
3) After the multi domain mapping is working, what specifically do I change to make it play nice with Cloudflare? I've been reading the different threads but I'm more confused than ever, which might be due to my very first problem mentioned over here.
I feel that I'm about 90% there and ready to start configuring the site, it's just the domain mapping that's holding me back.