[deleted] I was very curious as to what you tried adding at the end ?
For a quick guess at how i'd do it. (based on some copy-pasting from the "htaccess awesome" github):
First redirect to HTTPS (it's best to first redirect to HTTPS if using HSTS as it will protect the other domains if subsequent requests are made):
RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
See the rest of https://github.com/phanan/htaccess#force-https on how to add HSTS. Better only add HSTS once you're certain your config is ok !
Then second redirect all non "forum." subdomains to "forum.":
RewriteEngine on
RewriteCond %{HTTP_HOST} !^forum\.afwpe\.tk [NC]
RewriteRule ^(.*)$ https://forum.afwpe.tk/$1 [L,R=301]
or alternatively for second step redirect individual domains only:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.forum\.afwpe\.tk [NC]
RewriteRule ^(.*)$ https://forum.afwpe.tk/$1 [L,R=301]
Based on https://github.com/phanan/htaccess#force-non-www
In your first post, is there a difference between the following ?
I suppose placing these rules at the end should be fine. Make sure mod_rewrite is enabled (it's required to make flarum urls work in apache already)